View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ragup001 ragup001 is offline
external usenet poster
 
Posts: 3
Default 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