Hi
To all the crystal report experts on this forum, I hope that I can get some assistance in a formula that I am trying to create but the results that I am looking for escapes me.
I created a report that shows AP monthly transactions as a total, YTD and Prior YTD values as summary totals based upon the month the report was printed on a specific account.
I am able to get the monthly values but the YTD and the Prior YTD values is giving me values 12 months prior from the month the report is printing. However, I want the values from the beginning of the fiscal year to the month the report was printed.
For example, if the fiscal year is from October - September 2016, and I print the report for the 07 period, which is May month, the monthly values for May is accurate, but I want the YTD values to give me from October 2016 to May 2016 or from the 01 period to 08 period. So any month the report prints, the YTD should always starts from the beginning of the fiscal year.
Right now it is giving me 12 periods prior from the time the report was printed because 12 is hardcoded in the formula. This is the formula I am presently using:
StringVar BegPer;
StringVar EndPer;
If Right(RIPARAM("BegPerNbr"),2) = '12' then
BegPer := ToText(ToNumber(Left(RIPARAM("BEGPERNBR"),4))-0,"####") + '01'
Else
BegPer := ToText(ToNumber(Left(RIPARAM("BEGPERNBR"),4))-1,"####")+ ToText(ToNumber(Right(RIPARAM("BegPerNbr"),2))+1,'00') ;
EndPer := RIPARAM("BegPerNbr");
If {APTran.PerPost} <= EndPer and {APTran.PerPost} >= BegPer and {APDoc.DocType} = 'VO' then
{APTran.TranAmt}
I am also trying to use the dateserial and the in date formulae but so far I am not getting it to show what I am looking for. Could someone point me in the right direction. Any assistance will be greatly appreciated.
Thanks in advance