Date criteria

Harley

Registered User.
Local time
Today, 01:09
Joined
Dec 8, 2005
Messages
54
Can anyone see a problem with this criteria in my query?
SELECT Orders.[Date requested], Orders.[Item ordered], Orders.[Quantity ordered]
FROM Orders
WHERE (((Orders.[Date requested])>Date()-10))
ORDER BY Orders.[Date requested] DESC;
I get and "Undefined function 'Date' in expression." message. I don't get it! :)
 
Try DateDiff() function in which you specify parameters of -10, "d", and Now(). I think DateDiff will work correctly in a query.

If that doesn't work, you need to check your references. Search this forum for "References" to see a gazillion threads on the subject.
 
For other's information, it was a reference problem. :) Thanks for the suggestion! I had never run into that before and doubt I would have come up with the solution on my own.
 
Thanks for posting back with your solution. It might help others in the same situation (provided they search for the problem before posting :D )
 

Users who are viewing this thread

Back
Top Bottom