Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to format a date to be used in sqlstring in excel 2007?
I have a startdate in cell a1 as 12/1/2006 and enddate in cell a2 as
12/31/2006. These are used as parameters for a sqlstring in excel 2007. sqlstring = sqlstring & '12/1/2006' ,'12/31/2006' Excel gives me a run-time error '1004' : SQL syntax error. Can someone please tell me how to format the dates?? Thanks, Ragup |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to format a date to be used in sqlstring in excel 2007?
Seems to me that whenever I have to deal with dates I have to use # before
and after the date. This may not be the case for you at all, but I'd try: sqlstring = sqlstring & #12/1/2006# ,#12/31/2006# "ragup001" wrote: I have a startdate in cell a1 as 12/1/2006 and enddate in cell a2 as 12/31/2006. These are used as parameters for a sqlstring in excel 2007. sqlstring = sqlstring & '12/1/2006' ,'12/31/2006' Excel gives me a run-time error '1004' : SQL syntax error. Can someone please tell me how to format the dates?? Thanks, Ragup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 format cells to date format | Excel Discussion (Misc queries) | |||
Date format in Excel 2007 mm/dd/yy not appearing correctly | Excel Worksheet Functions | |||
Date format with Excel 2007 | Excel Discussion (Misc queries) | |||
Date format on axis in Excel 2007 | Charts and Charting in Excel | |||
Excel 2007 Date Format Problem | Excel Discussion (Misc queries) |