All of current year and all of last year.

travismp

Registered User.
Local time
Today, 08:32
Joined
Oct 15, 2001
Messages
386
Old code

Code:
PASS: Switch([AD_DrugDate]<Date()-365 Or [AD_AlcoholDate]<Date()-365,'FAIL')

This used to look at everything from the past 365 days. I need to change it to show all of the current year, and all of the last year. So if I ran it today it would show all of 2008 and 2007 records for those two columns.

Thank you all...
 
The following code returns 1/1/2007 when run this afternoon:

SELECT DateSerial(Year(Date())-1,1,1) from Table2;
 
You can also use
CurrentYear:Sum(iif(year(xdate)=year(date()),amount,0)
LastYear:Sum(iif(year(xdate)=(year(date())-1),amount,0)

where xdate is the name of your date column and amount is the name of column which contains amount to be used for calculation
 

Users who are viewing this thread

Back
Top Bottom