Solved

MS excel database query

Posted on 2012-04-08
11
522 Views
Last Modified: 2012-04-16
Hi,

I am running a data base query into excel 2007 from access 2007.  I brought all the columns across from access into excel.  Is there a way to only bring across records that have data?

Thanks in advance.
0
Comment
Question by:Reyesrj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 40

Assisted Solution

by:als315
als315 earned 100 total points
ID: 37822489
Yes, you can add criteria to your query:
.... WHERE MyfieldName is not NULL
0
 
LVL 17

Assisted Solution

by:Anuroopsundd
Anuroopsundd earned 100 total points
ID: 37822493
in the query you can specify that data not equal to null

1.On the Data tab, in the Get External Data group, click From Other Sources, and then click From Microsoft Query.
2.In the Choose Data Source dialog box, make sure that the Use the Query Wizard to create/edit queries check box is clear.
3.Double-click the data source that you want to use.

http://office.microsoft.com/en-us/excel-help/use-microsoft-query-to-retrieve-external-data-HA010099664.aspx
0
 

Author Comment

by:Reyesrj
ID: 37822530
Thanks for the reply,

I have 10 rows and 15 columns that came accross.  Only 3 rows and 5 columns have data.  Is there a way to only have those 3 rows and all the columns come accross?  Meaning to say, only bring accross the records that have data.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 30

Assisted Solution

by:hnasr
hnasr earned 100 total points
ID: 37823762
Verify that the Access query outputs the expected records, then proceed to get data into Excel.
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 100 total points
ID: 37824832
Can you post a sample of this spreadsheet to avoid the "guesswork" of figuring out what you are calling "Rows that have data"

The question is how you are allowing "Empty" records in your Excel sheet?
This is why a sample file and an explanation of your system is always helpful...

Basically Access swill import all of the data in the sheet (the "List Range")
(There is no facility to tell Access what you think are "Empty" records and ignore them.)
Then you will have to filter out the "Non Blank" records in Access.
(Easy)

Either that or Filter the records in Excel first, then import the "Filtered list"
(More difficult)
0
 

Author Comment

by:Reyesrj
ID: 37826453
Please see that attached query result in excel.

Rows 5,6 and 9 have data in column c through M.  The outher rows do not have data.  So, is there a way to only bring accross records that have data in column c through 9?

Thanks
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37827748
<Please see that attached query result in excel.>
Attached where?
0
 

Author Comment

by:Reyesrj
ID: 37828081
Sorry, I'm at home. I guess the attachment did not attach. I'll send it tomorrow.
Thanks.
0
 
LVL 9

Accepted Solution

by:
Anthony Mellor earned 100 total points
ID: 37834741
Powerpivot will do that in a point and click way.
0
 

Author Comment

by:Reyesrj
ID: 37835613
0
 

Author Closing Comment

by:Reyesrj
ID: 37853976
Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question