Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Totals On Conditional Fields

Status
Not open for further replies.

Richg6

MIS
May 22, 2002
2
GB
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

 
When you assign a value to a variable, it's :=, not =.

Naith
 
Like, Doh!!!!

Wood and trees spring to mind.

Cheers Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top