charlieintegral
MIS
Hi, hope you can help.
I am trying to group a datetime field into "current month", "previous month" and ">previous months"
e.g current - January 2007
Previous - December 2006
>Previous - November back to 2004
this is what I have so far, but I can't work out how to get >previous months without writing it out long hand,-2,-3 etc
if (month({@DUE_DATE}) = Month (currentdate)
AND YEAR ({@DUE_DATE}) = YEAR (CURRENTDATE))
then "CURRENT MONTH"
ELSE if {@DUE_DATE} in
dateserial(year(currentdate),month(currentdate)-1,1)
to_
dateserial(year(currentdate),month(currentdate),1)
then "PREVIOUS MONTH
I am trying to group a datetime field into "current month", "previous month" and ">previous months"
e.g current - January 2007
Previous - December 2006
>Previous - November back to 2004
this is what I have so far, but I can't work out how to get >previous months without writing it out long hand,-2,-3 etc
if (month({@DUE_DATE}) = Month (currentdate)
AND YEAR ({@DUE_DATE}) = YEAR (CURRENTDATE))
then "CURRENT MONTH"
ELSE if {@DUE_DATE} in
dateserial(year(currentdate),month(currentdate)-1,1)
to_
dateserial(year(currentdate),month(currentdate),1)
then "PREVIOUS MONTH