Solved

MS excel database query

Posted on 2012-04-08
11
518 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

809 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