I need to write a query which identifies the latest date in the database and then goes back 3 months. In other words, if the latest data is for October 2002, then I need the data for August, September and October. When the data is updated with November data, then the query should pick up September, October, and November data.
I have tried the following SQL:
I have tried the following SQL:
Code:
SELECT Sum(Daily.Amount) AS SumOfAmount
FROM Daily
WHERE (((Monthly.Date) Between DateAdd("m",-3,Date()) And Date()));
[code]
but before the November data is loaded, this will only pick up Sept and Oct data if it is currently November.
Can I include the Max function within the DateAdd function?
Thanks!