Solved

MS excel database query

Posted on 2012-04-08
11
517 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 39

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
 
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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:
anthonymellorfca 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

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…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now