CR10
Progress
Hi ALL
I have a problem conditionally adding totals in a report. The group consists of group of a date displayed by month. I have created a counter in the group due the fact that you aren't always gauranteed to get concurrent months back, so datdiffs and counts of CDate isn't happening.
The issue is if there are 13 months brought back the 13th is ignored and the next,3,6,9,and 12 month cumulatives are calculated. The 13th month would be the most recent ie would be number 13, so i am using
whileprintingrecords;
numbervar Gross1;
numbervar counter;
if counter in [10 to 12]
Then
If (OnFirstRecord or {debt.debt-code} <> Previous({debt.debt-code})) then
Gross1 := Gross1 + {debt.dt-debtval}
else
Gross1 := Gross1
This works fineif there are 13 months, but if there are say only 11, or 10 months brought back this throws the calulation out of wack. You cant use maximum with the counter and i've tried counter -3 to counter but no joy any ideas
Thanks in advance
Progress
Hi ALL
I have a problem conditionally adding totals in a report. The group consists of group of a date displayed by month. I have created a counter in the group due the fact that you aren't always gauranteed to get concurrent months back, so datdiffs and counts of CDate isn't happening.
The issue is if there are 13 months brought back the 13th is ignored and the next,3,6,9,and 12 month cumulatives are calculated. The 13th month would be the most recent ie would be number 13, so i am using
whileprintingrecords;
numbervar Gross1;
numbervar counter;
if counter in [10 to 12]
Then
If (OnFirstRecord or {debt.debt-code} <> Previous({debt.debt-code})) then
Gross1 := Gross1 + {debt.dt-debtval}
else
Gross1 := Gross1
This works fineif there are 13 months, but if there are say only 11, or 10 months brought back this throws the calulation out of wack. You cant use maximum with the counter and i've tried counter -3 to counter but no joy any ideas
Thanks in advance