Year/ month query

driver7408

Registered User.
Local time
Yesterday, 18:54
Joined
Feb 7, 2010
Messages
72
I'm working on an expression in my Query. So far I have

Year([Query2.DateIssued])=Year(Date())

This returns everything in the current year. I need also for it to return the last 3 months of last year as well, in addition to the current year. Can someone please tell me how I would write it to get those results?

P.S.I cant use specific dates because this needs to work at any given time over a few years.

Thanks a lot.
 
Actually, the criteria in the [DateIssued] field should be:

Between DateSerial(Year(Date()),Month(Date())-3,1) And DateSerial(Year(Date()), Month(Date())+1,0)
 
Actually, the criteria in the [DateIssued] field should be:

Between DateSerial(Year(Date()),Month(Date())-3,1) And DateSerial(Year(Date()), Month(Date())+1,0)


I tried that; it only returned 3 months. Something tells me this isn't such an easy query expression. Might just have to base the expression off of a calculated control on my form.
 
Oh, I missed the part about the last 3 months of last year as well as the current year. So, try this instead:

Between DateSerial(Year(Date())-1,9,1) And DateSerial(Year(Date()), Month(Date())+1,0)
 
Not quite it, but I changed a couple items and was able to get it working. Thanks so much for your help!

Between DateSerial(Year(Date())-1,9,1) And DateSerial(Year(Date())+0,9,0)
 

Users who are viewing this thread

Back
Top Bottom