• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 815
  • Last Modified:

Using Today's date as MSQuery filter criterion

With Excel 2010, I am querying a SQL database using msquery.
 I am trying to use today's date as a criterion.
The criterion being 'select to_date if to_date is greater than or equal to today's date'

I have tried:
>=today()
>=now()
>=int(now())
>=current_date()
MSQuery-TODAY-CRITERION-ERROR.docx
All to no avail.

The error message for each of these is:
'today' is not a recognized built-in function name. Statement(s) could not be prepared, etc....

Please see attached sample screenshot.
Can anyone clarify please?
Thanks
David
0
David Phelops
Asked:
David Phelops
1 Solution
 
Jared_SCommented:
Try getdate()
0
 
David PhelopsAuthor Commented:
Ta-Da!
Thank you very much indeed.
That worked a treat!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now