Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I recorded the following macro for to import data from SQL.
At line 5 why is there ", " in the syntax i.e. {ts '2004-02-18 00:00:", "00'} ? I want to reduce this to {ts '2004-02-18 00:00:00'} but I get type mismatch What is the ", " there for and why cant I get rid of it. I want to replace the hard coded date with a variable. Dave .CommandText = Array( _ "SELECT qry_ASX_52Weeks.WeekEnding, qry_ASX_52Weeks.ASXCode, qry_ASX_52Weeks.AveWeeklyClose" & Chr(13) & "" & Chr(10) & _ "FROM qry_ASX_52Weeks qry_ASX_52Weeks" & Chr(13) & "" & Chr(10) & _ "WHERE (qry_ASX_52Weeks.WeekEnding<={ts '2004-02-18 00:00:", "00'} And qry_ASX_52Weeks.WeekEnding={ts '" _ & Start & _ "'}) AND (qry_ASX_52Weeks.ASXCode='" & compname & "')" & Chr(13) & "" & Chr(10) & _ "ORDER BY qry_ASX_52Weeks.WeekEnding") |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
using a conditional suffix in text function format syntax=text(value,format_text) | Excel Worksheet Functions | |||
Extract the text between last comma and last but one comma. | Excel Worksheet Functions | |||
Pivot Table Error Message - "Command Text not set for command obje | Excel Discussion (Misc queries) | |||
syntax for "IF" commend to check for multiple empty cells bf comma | Excel Worksheet Functions | |||
Correct syntax for use Replace command via DDE? | Excel Programming |