Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel odbc ms query using cell as criteria value
I have a excel odbc ms query of a sql db. I need to be able to pull one of
the criteria value from annother cell in excel that will change once a month. Can anyone tell me how I would do this? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel odbc ms query using cell as criteria value
your SQL would look like this:
SELECT [selection] FROM [source] WHERE [column] = '%token%' in VBA, you could replace the token by the value in a cell... lets say a string variable, sSQL contains the SQL text above, then sSQL = REPLACE(sSQL,"%token%", sheet1.range("B1").Value) "mgunther" wrote: I have a excel odbc ms query of a sql db. I need to be able to pull one of the criteria value from annother cell in excel that will change once a month. Can anyone tell me how I would do this? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel cell contents to query criteria | Excel Discussion (Misc queries) | |||
Using A Cell In Excel as Criteria for a Query | Excel Discussion (Misc queries) | |||
How do I update a ODBC query in Excel using pivotTables in VBA? | Excel Programming | |||
Excel ODBC Query | Excel Programming | |||
EXCEL AND ODBC AND QUERY | Excel Programming |