I have a formula which sets variables based on the date. My problem is for some of the variables the value is getting updated twice for the last record in the group. It only seems to happen with the Month variables, the Fiscal Year ones have the correct value.
Details on the formulas and report setup are below. Any suggestions would be greatly appreciated. I am using Crystal 8.5 against a SQL Server 2000 db.
Thanks,
Joy
The report is grouped by product code.
Group Header: Reset Function
Detail Section (Suppressed)
WhilePrintingRecords;
numberVar JulyQuantity; numberVar AugQuantity;numberVar SeptQuantity; numberVar OctQuantity;numberVar NovQuantity;
numberVar DecQuantity;numberVar JanQuantity; numberVar FebQuantity;numberVar MarQuantity; numberVar AprQuantity;
numberVar MayQuantity; numberVar JuneQuantity;numberVar LastFYSales;numberVar LastFYQuantity;numberVar ThisFYQuantity;numberVar ThisFYSales;
If {Activity.TRANSACTION_DATE} >= Date(Year({@Fiscal Year Start}),07,01) and
{Activity.TRANSACTION_DATE} < Date(Year({@Fiscal Year Start}),08,01) then
(JulyQuantity:=JulyQuantity + {Activity.QUANTITY};
ThisFYQuantity:=ThisFYQuantity+{Activity.QUANTITY};
ThisFYSales:= ThisFYSales + tonumber({Activity.AMOUNT})) else
If {Activity.TRANSACTION_DATE} >= Date(Year({@Fiscal Year Start}),08,01) and
{Activity.TRANSACTION_DATE} < Date(Year({@Fiscal Year Start}),09,01) then
(AugQuantity:=AugQuantity;AugQuantity:=AugQuantity + {Activity.QUANTITY};
ThisFYQuantity:=ThisFYQuantity+{Activity.QUANTITY};
ThisFYSales:=ThisFYSales+ tonumber({Activity.AMOUNT})) else
etc...
Group Footer: Formulas to display the calculated quantities
WhilePrintingRecords;
numberVar JulyQuantity;
JulyQuantity
WhilePrintingRecords;
numberVar AugQuantity;
AugQuantity
Details on the formulas and report setup are below. Any suggestions would be greatly appreciated. I am using Crystal 8.5 against a SQL Server 2000 db.
Thanks,
Joy
The report is grouped by product code.
Group Header: Reset Function
Detail Section (Suppressed)
WhilePrintingRecords;
numberVar JulyQuantity; numberVar AugQuantity;numberVar SeptQuantity; numberVar OctQuantity;numberVar NovQuantity;
numberVar DecQuantity;numberVar JanQuantity; numberVar FebQuantity;numberVar MarQuantity; numberVar AprQuantity;
numberVar MayQuantity; numberVar JuneQuantity;numberVar LastFYSales;numberVar LastFYQuantity;numberVar ThisFYQuantity;numberVar ThisFYSales;
If {Activity.TRANSACTION_DATE} >= Date(Year({@Fiscal Year Start}),07,01) and
{Activity.TRANSACTION_DATE} < Date(Year({@Fiscal Year Start}),08,01) then
(JulyQuantity:=JulyQuantity + {Activity.QUANTITY};
ThisFYQuantity:=ThisFYQuantity+{Activity.QUANTITY};
ThisFYSales:= ThisFYSales + tonumber({Activity.AMOUNT})) else
If {Activity.TRANSACTION_DATE} >= Date(Year({@Fiscal Year Start}),08,01) and
{Activity.TRANSACTION_DATE} < Date(Year({@Fiscal Year Start}),09,01) then
(AugQuantity:=AugQuantity;AugQuantity:=AugQuantity + {Activity.QUANTITY};
ThisFYQuantity:=ThisFYQuantity+{Activity.QUANTITY};
ThisFYSales:=ThisFYSales+ tonumber({Activity.AMOUNT})) else
etc...
Group Footer: Formulas to display the calculated quantities
WhilePrintingRecords;
numberVar JulyQuantity;
JulyQuantity
WhilePrintingRecords;
numberVar AugQuantity;
AugQuantity