I have a sales report, I need to calculate Today sales, month sales and YTD sales.
I am using following formula to calculate Today and YTD figures but I am not able figure out how to calculate month's figures.
I am using {?Sale -End Date} parameter
Any help in month's formula would be great help
if {SOP30200.GLPOSTDT} > {?Sale -End Date}-1 and {SOP30200.GLPOSTDT} <= {?Sale -End Date}
and month({?Sale -End Date}) = month ({?Sale - Start Date })
and {SOP30200.SOPTYPE} = 3
then {SOP30300.XTNDPRCE}
else if {SOP30200.GLPOSTDT} > {?Sale -End Date}-1 and {SOP30200.GLPOSTDT} <= {?Sale -End Date}
and month({?Sale -End Date}) = month ({?Sale - Start Date })
and {SOP30200.SOPTYPE} = 4
then {SOP30300.XTNDPRCE}*-1
else 0.00
and for YTD figures:
if {SOP30200.GLPOSTDT} >= CDateTime(2005,01,01,00,00,00) and {SOP30200.GLPOSTDT} <= {?Sale -End Date}
and {SOP30200.SOPTYPE} = 3
then {SOP30300.EXTDCOST}
else if {SOP30200.GLPOSTDT} >= CDateTime(2005,01,01,00,00,00) and {SOP30200.GLPOSTDT} <= {?Sale -End Date}
and {SOP30200.SOPTYPE} = 4
then {SOP30300.EXTDCOST}*-1
else 0.00
Thanks
-b
I am using following formula to calculate Today and YTD figures but I am not able figure out how to calculate month's figures.
I am using {?Sale -End Date} parameter
Any help in month's formula would be great help
if {SOP30200.GLPOSTDT} > {?Sale -End Date}-1 and {SOP30200.GLPOSTDT} <= {?Sale -End Date}
and month({?Sale -End Date}) = month ({?Sale - Start Date })
and {SOP30200.SOPTYPE} = 3
then {SOP30300.XTNDPRCE}
else if {SOP30200.GLPOSTDT} > {?Sale -End Date}-1 and {SOP30200.GLPOSTDT} <= {?Sale -End Date}
and month({?Sale -End Date}) = month ({?Sale - Start Date })
and {SOP30200.SOPTYPE} = 4
then {SOP30300.XTNDPRCE}*-1
else 0.00
and for YTD figures:
if {SOP30200.GLPOSTDT} >= CDateTime(2005,01,01,00,00,00) and {SOP30200.GLPOSTDT} <= {?Sale -End Date}
and {SOP30200.SOPTYPE} = 3
then {SOP30300.EXTDCOST}
else if {SOP30200.GLPOSTDT} >= CDateTime(2005,01,01,00,00,00) and {SOP30200.GLPOSTDT} <= {?Sale -End Date}
and {SOP30200.SOPTYPE} = 4
then {SOP30300.EXTDCOST}*-1
else 0.00
Thanks
-b