![]() |
How to pass a date in Excel to ms query
Tom,
Thanks for the tip. That was exactly what I needed. "Vince" wrote: The following code works fine, but I need the date referenced in the query to update automatically with the date that is located in Cell A1 of the spreadsheet. I would appreciate any help given. Vince ---------------------------------------------------------------------------------------- With Selection.QueryTable .Connection = Array(Array( _ "ODBC;DSN=MS Access Database;DBQ=C:\ABBTemp\STK5.MDB;DefaultDir=C:\ABB Temp;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5" _ ), Array(";")) .CommandText = Array( _ "SELECT `Shift/Day Report`.Date, `Shift/Day Report`.`PRODUCTION TONS_DAY`" & Chr(13) & "" & Chr(10) & "FROM `C:\ABBTemp\STK5`.`Shift/Day Report` `Shift/Day Report`" & Chr(13) & "" & Chr(10) & "WHERE (`Shift/Day Report`.Date={ts '2004-04-01 00:00:00'})" & Chr(13) & "" & Chr(10) & "O" _ , "RDER BY `Shift/Day Report`.Date") .Refresh BackgroundQuery:=False End With |
All times are GMT +1. The time now is 05:45 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com