urgent help with dates

mistaking

Registered User.
Local time
Today, 19:11
Joined
Apr 16, 2002
Messages
16
I need to build a query that shows all invoices for the current month a year ago.
What i want to do is prompt for the current date(not a problem).
Then I think I need to somehow take a year away from this date and look for all the invoices for that year in the current month only.
Does anyoone know how I would form such a query?
 
In the criteria for the date field you would need to use the DateSerial function:

Between (DateSerial(Year(Date()-1),Month(Date(),1),Day(Date())) and DateSerial(Year(Date()-1),Month(Date()+1,1),Day(Date()))

I haven't tested this so you may need to fiddle with it. Search the forum on DateSerial - there's quite a bit that would help you solve it.
 
Thanks the answer was a lot simpler, what i used was - Field: Year([date field])
Criteria: Year([Enter date])-1
 

Users who are viewing this thread

Back
Top Bottom