Hi:
Thanks in advance for your help from a relatively inexperienced user. I am using Crystal v10 via OBDC connection to SQL server.
I am trying to write a formula selecting sales for a product for the prior three complete calendar months. For example, if the report is run anytime in January, I need all sales for the full months of October, November and December. Run anytime in February, sales for November, December and January.
I have a formula which does work but seems to be very clunky.
if month(currentdate) - month({InvOutDist.DELIVERY_DATE}) in [-11,-10,-9] then
month(currentdate) - month({InvOutDist.DELIVERY_DATE}) in [-11,-10,-9] and
year(currentdate) - year({InvOutDist.DELIVERY_DATE}) in [1])
else
month(currentdate) - month({InvOutDist.DELIVERY_DATE}) in [1,2,3] and
year(currentdate) - year({InvOutDist.DELIVERY_DATE}) in [0])
Is there an easier, smoother way to do this?
Thanks.
Thanks in advance for your help from a relatively inexperienced user. I am using Crystal v10 via OBDC connection to SQL server.
I am trying to write a formula selecting sales for a product for the prior three complete calendar months. For example, if the report is run anytime in January, I need all sales for the full months of October, November and December. Run anytime in February, sales for November, December and January.
I have a formula which does work but seems to be very clunky.
if month(currentdate) - month({InvOutDist.DELIVERY_DATE}) in [-11,-10,-9] then
month(currentdate) - month({InvOutDist.DELIVERY_DATE}) in [-11,-10,-9] and
year(currentdate) - year({InvOutDist.DELIVERY_DATE}) in [1])
else
month(currentdate) - month({InvOutDist.DELIVERY_DATE}) in [1,2,3] and
year(currentdate) - year({InvOutDist.DELIVERY_DATE}) in [0])
Is there an easier, smoother way to do this?
Thanks.