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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using RptFunction to add more than one field

Status
Not open for further replies.

JaeBrett

Programmer
May 5, 2003
196
CN
I have a Data Report that brings back fields such as 'cash', 'debit', 'cc', 'cheques'. Is there a function type to add the sum of all of them?
I can obviously use the FunctionType '0-rptFuncSum' to get the sum of one field ... but what do I do for the sum of all?


Thanks
 
For the sum on all fields for a single record, add the fields in the sql statement:

SELECT Field1, Field2, Field3, Filed1+Field2+Field3 FROM SomeTable

For a Grand total, use the report function control to sum each field, then add the value of the 3 controls together.
 
How do I add the value of rptFunction Controls together?
 
It was just an idea. I don't really use the DataReport.
But it looks like this isn't possible.

So, use:

SELECT Field1, Field2, Field3, Fieled1+Field2+Field3 As TheTotal FROM SomeTable

and then use a report function on the "TheTotal" field.


 
I just added them within my form and sent it to my DataReport, easier than fiddling with it for any longer.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top