Solved

MS excel database query

Posted on 2012-04-08
11
519 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
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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Suggested Solutions

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

820 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