Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
what expression would I use to find the same date, but last year or quarter? My best guess would be
Today()-quarter
Today()-year
inquartertodate (Feedback.TempDate,addmonths(today(), -3),0) *-1 as Feedback.LQTDFlag
addyears(today(), -1) will give you the previous year date
addyear(today(), -1, ceil(month(today()/3) will give you year and quarter
thanks Michiel
how about just last quarter though, instead of last quarter and year?
ceil(num(month(addyears(today(), -1))/3) as Quater_lastYear
So currently I have a line in my master calendar which flags if a date is in the last quarter to date.
inquartertodate (Feedback.TempDate,'2013-11-14',0) *-1 as Feedback.LQTDFlag
Obviously the problem with this is that I have to change the date manually each day. I tried insert your suggestion in place of '2013-11-14' (as per below) but i got an error
inquartertodate (Feedback.TempDate,ceil(num(month(addyears(today(), -1))/3),0) *-1 as Feedback.LQTDFlag
what am I doing wrong?
You have a calculated quarter in the basedate. This should be a date.
Try this:
inquartertodate (Feedback.TempDate,today(),0) *-1 as Feedback.LQTDFlag
That gives me the current quarter to date unfortunately. I actually need the last quarter to date
inquartertodate (Feedback.TempDate,addmonths(today(), -3),0) *-1 as Feedback.LQTDFlag
PERFECT! thanks