Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

current date formual for msquery 2

Status
Not open for further replies.

rewob65

Technical User
Nov 13, 2004
110
GB
I am using MSQuery in Excel and want a criteria where the field is less than current date. i cannot find the sql criteria CurrentDate does not work

Thanks


 




Hi,
It depends what type of database you are tapping.

If its Oracle or DB2 its SYSDATE.
Code:
Where [The Field] < SYSDATE
If its Access or an Excel table, it's DATE().
Code:
Where [The Field] < DATE()


Skip,
[sub]
[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue][/sub]
 
Neither worked, I am trying to get into a pervasive database if you have any idea?
 
Why not use a parameter query which picks up the date from a cell in Excel. then you can simply use the Today() function

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top