Using values in Excel as parameters in Microsoft Query connection

D

Dan

I currently have an Excel sheet containing data, and I'd like to create a SQL
query where parameters in my query are fields in my Excel sheet. I know how
to create a SQL query or other data connection, but I don't know how to
include my Excel data as a datasource in the query. Is this possible, and, if
so, how would I do it?


Thanks in advance,
Dan
 
B

Brotha Lee

Dan,

You can do this by using the importing external data query:

1) Go to data, import external data, new database query
2) Select or browse to the database you wish to connect to
3) Click cancel in the next screen and Click yes to open the macro Query
editor
4) Create your query and add filters to it
5) In the filter list enter "[Your description]"
6) Return the data to excel
7) Click on the Parameter button and select the cell where your criteria
houses.

Regards,

Brotha lee
 
D

Dan

Sorry; I should have mentioned that I'm using Excel 2007. I know that you can
filter your results in 2007, as you mention below, but don't remember how &
have had no luck using Excel Help.





Brotha Lee said:
Dan,

You can do this by using the importing external data query:

1) Go to data, import external data, new database query
2) Select or browse to the database you wish to connect to
3) Click cancel in the next screen and Click yes to open the macro Query
editor
4) Create your query and add filters to it
5) In the filter list enter "[Your description]"
6) Return the data to excel
7) Click on the Parameter button and select the cell where your criteria
houses.

Regards,

Brotha lee


Dan said:
I currently have an Excel sheet containing data, and I'd like to create a SQL
query where parameters in my query are fields in my Excel sheet. I know how
to create a SQL query or other data connection, but I don't know how to
include my Excel data as a datasource in the query. Is this possible, and, if
so, how would I do it?


Thanks in advance,
Dan
 
D

Dan

Never mind...just figured it out. Thanks for the help.


Dan said:
Sorry; I should have mentioned that I'm using Excel 2007. I know that you can
filter your results in 2007, as you mention below, but don't remember how &
have had no luck using Excel Help.





Brotha Lee said:
Dan,

You can do this by using the importing external data query:

1) Go to data, import external data, new database query
2) Select or browse to the database you wish to connect to
3) Click cancel in the next screen and Click yes to open the macro Query
editor
4) Create your query and add filters to it
5) In the filter list enter "[Your description]"
6) Return the data to excel
7) Click on the Parameter button and select the cell where your criteria
houses.

Regards,

Brotha lee


Dan said:
I currently have an Excel sheet containing data, and I'd like to create a SQL
query where parameters in my query are fields in my Excel sheet. I know how
to create a SQL query or other data connection, but I don't know how to
include my Excel data as a datasource in the query. Is this possible, and, if
so, how would I do it?


Thanks in advance,
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top