View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ronald S. Cook Ronald S. Cook is offline
external usenet poster
 
Posts: 4
Default How refer to current date in Excel SQL query?

I'm trying to use Microsoft Query within Excel to write a SQL query against
a data set.

SELECT e.EVENTNAME, e.EVENTDATE
FROM EVENT e
WHERE (e.EVENTDATE = DATE()
ORDER BY e.EVENTDATE

In the above, DATE() is not correct to get the current system date. I tried
DATE, NOW, NOW(), GETDATE, GETDATE(), TODAY, TODAY().. now of which worked.

Can someoine please tell me the correct syntax?

Thanks!
Ron