Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Excel - New Database Query - using dates in Excel as criteria

Status
Not open for further replies.

daggers

Technical User
Sep 10, 2002
13
GB
Hi,

Does anyone know how to link dates in an Excel spreadsheet to criteria in Query?

For any other criteria, i.e. names or constants, it is simple - in Query, in the criteria field of the chosen data category put in [name], then in Excel link the criteria by selecting 'Query Parameters' and 'Get the value from the following cell'.

Then whenever the Query is refreshed, the criteria is lifted from the Excel spreadsheet.

Unfortunately it refuses to do this for dates! Does anyone know how to make it work for dates too?

Thanks
Ross
 
if using vba...
add the # sign..IE

"where somefield =#"+date$+"#;)"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top