View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter Hesselager Peter Hesselager is offline
external usenet poster
 
Posts: 18
Default Date format in Excel query

Hi Group.
I created this query with Excel Macro, and it works.
Then I put a date in a cell in Excel, and assigned the value to Variable
StartDate, and it works.
Now I want to put the StartDate into the WHERE instead of 2005-01-04, but
that does NOT work.
Any Ideas ?

"SELECT DebJournal.Konto, DebJournal.Dato, DebJournal.Varebeløb" & Chr(13) &
"" & _
Chr(10) & "FROM DebJournal DebJournal" & Chr(13) & "" & Chr(10) &
"WHERE (DebJournal.Dato={d '2005-01-04'})" & Chr(13) & "" & Chr(10) & "ORDER
BY DebJournal.Konto, DebJournal.Dato" _
)
.Refresh BackgroundQuery:=False

--
Med venlig hilsen
Peter Hesselager-Olesen
SBS-IT Aps