Sorry but made a mistake in the second formula.
if datepart("q",currentdate)=1 then
datepart("q",{INIDP.INVDAT})=4
and datepart("yyyy",{INIDP.INVDAT})=datepart("yyyy",dateadd("yyyy",1,currentdate)-1)
else
datepart("q",{INIDP.INVDAT})=datepart("q",dateadd("q",-2,currentdate)-1)
and...
I am trying to calculate sales for the previous quarter both this year and for last. I am using the following:
Previous qtr same year
if datepart("q",currentdate)=1 then
datepart("q",{INIDP.INVDAT})=4
and datepart("yyyy",{INIDP.INVDAT})=datepart("yyyy",dateadd("yyyy",-1,currentdate))
else...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.