SQL Query with constraint in a cell

D

Dan

Excel 2007: I am pulling data from an external source (Data ribbon, From
Other Sources, From SQL Server) using a query:

Select * from Transactions where TransType = 'NEW'

I'd like to put the value of TransType in a cell, so I can change the value
in the workbook, <Refresh ALL>, and the query runs with a different
constraint.

Is this possible? How do I pass the value of a cell to the query? I prefer
to NOT use VB, a form, or a macro.

Thanks! in advance.

--Dan
 
F

figdatbong

I may well be wrong here but I'm not sure that you can avoid using VB for
this?? Your command text would be dependant on a value held within your
worksheet so this would need to be constructed each time you update the
file?
 

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