bassispunk
08-03-2001, 10:47 AM
what is the syntax needed to run a query that will only return data that has been entered within the past 2 weeks. for example, the query will return all entries into a form where the date field falls between the current date and 2 weeks ago. thanks
>=DateAdd("d",-14,Date()) in the criteria grid.
raskew
08-03-2001, 02:06 PM
First, lookup "Parameters Declaration" in the help file, then try copying/pasting this parameter query SQL into a new query in Northwind. When prompted to enter mydate, use something like 9/14/94. Hopefully, this will provide sufficient insight to design your own:
PARAMETERS mydate DateTime;
SELECT Orders.*, Orders.OrderDate
FROM Orders
WHERE (((Orders.OrderDate) Between DateAdd("d",-14,[mydate]) And [mydate]));