I'm having trouble creating a running total on a calculated field. There seem to be two problems. What I want to do is take the total from a field calculated like this:
IF {EmpHourRateFactor.HoursAtRate7} <> 0 THEN
{EmpHourRateFactor.HoursAtFactor2} - {EmpHourRateFactor.HoursAtRate2}
So I create a running total field thus:
whileprintingrecords;
currencyvar hol12tot;
hol12tot = hol12tot + {@Holiday12};
Now this just gives me a boolean value, true or false (?)
So I tried this:
whileprintingrecords;
currencyvar hol12tot;
hol12tot = hol12tot + {@Holiday12};
hol12tot;
Which gives me a number, pity it's always zero really....
I've tried messing with the whileprintingrecords (but don't completely understand where this all sits in terms of passes), I've also tried passing the result of the initial subtraction into a variable, which also gives me a zero. I am assuming it may be something to do with the pass order or something (incidentally, the database stores the records as a currency var, thus the declaration). It may be of relevance to point out that there is a sub total of the first field already (which works fine).
Any ideas as to why this is happening may prevent further hair loss.
Thanks
Richard
IF {EmpHourRateFactor.HoursAtRate7} <> 0 THEN
{EmpHourRateFactor.HoursAtFactor2} - {EmpHourRateFactor.HoursAtRate2}
So I create a running total field thus:
whileprintingrecords;
currencyvar hol12tot;
hol12tot = hol12tot + {@Holiday12};
Now this just gives me a boolean value, true or false (?)
So I tried this:
whileprintingrecords;
currencyvar hol12tot;
hol12tot = hol12tot + {@Holiday12};
hol12tot;
Which gives me a number, pity it's always zero really....
I've tried messing with the whileprintingrecords (but don't completely understand where this all sits in terms of passes), I've also tried passing the result of the initial subtraction into a variable, which also gives me a zero. I am assuming it may be something to do with the pass order or something (incidentally, the database stores the records as a currency var, thus the declaration). It may be of relevance to point out that there is a sub total of the first field already (which works fine).
Any ideas as to why this is happening may prevent further hair loss.
Thanks
Richard