Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
datetime in query
How can I replace {ts '1990-12-31 00:00:00'} in the query
macro with any time I want? For example, I defined a string called LastTime, and set LastTime = "2003-07-23 00:00:00". But {ts 'LastTime'} will not work. {ts '1990-12-31 00:00:00'} is ANSI standard datetime format Here are few lines from my macro: With Selection.QueryTable ..Connection = _ "ODBC;DRIVER= {MicrosoftODBCforOracle};UID=ICL;PWD=USER;SERVER=V GSM;" ..CommandText = Array( _ "SELECT SAMPLE_ACTIVE.LOGIN_DATE" & Chr(10) & "FROM VGSM.SAMPLE_ACTIVE SAMPLE_ACTIVE" _ & Chr(10) _ & "WHERE (SAMPLE_ACTIVE.LOGIN_DATE{ts '1990-12-31 00:00:00'})") ..Refresh End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
datetime in query
Ling
....{ts '" & LastTime & "'}... The SQL statement inside the array is just a string, so you can concatenate with the ampersand. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Ling" wrote in message ... How can I replace {ts '1990-12-31 00:00:00'} in the query macro with any time I want? For example, I defined a string called LastTime, and set LastTime = "2003-07-23 00:00:00". But {ts 'LastTime'} will not work. {ts '1990-12-31 00:00:00'} is ANSI standard datetime format Here are few lines from my macro: With Selection.QueryTable .Connection = _ "ODBC;DRIVER= {MicrosoftODBCforOracle};UID=ICL;PWD=USER;SERVER=V GSM;" .CommandText = Array( _ "SELECT SAMPLE_ACTIVE.LOGIN_DATE" & Chr(10) & "FROM VGSM.SAMPLE_ACTIVE SAMPLE_ACTIVE" _ & Chr(10) _ & "WHERE (SAMPLE_ACTIVE.LOGIN_DATE{ts '1990-12-31 00:00:00'})") .Refresh End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Datetime CSV format | Excel Discussion (Misc queries) | |||
Remove Time from DateTime | Excel Discussion (Misc queries) | |||
pop up calendar using MS DateTime Picker | Excel Worksheet Functions | |||
MS Query DateTime String | Excel Worksheet Functions | |||
autodate and datetime stamp | Excel Worksheet Functions |