Forum Discussion

cjhent's avatar
cjhent
New Contributor
11 years ago

How do I sum totals for 1 database field

Hi

I am new to this, so looking for a bit of help.

I have the following code, which works correctly ( but I have changed the parameters for security reasons )

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:sec="http://www.registernow.com.au/secure/Services/SecureServices.asmx">
<soap:Header/>
<soap:Body>
<sec:GetCharges>
<sec:eventId>123</sec:eventId>
<sec:ApiKey>12345678</sec:ApiKey>
</sec:GetCharges>
</soap:Body>
</soap:Envelope>


So the above code returns to me all the fields in the database and a heap of other results from a database.
- I only want 1 field however and then to sum the totals of that 1 field.
- the field is called "ChargeTotal"

So if I have 4 rows of data with the ChargeTotal being 10,20,20,10
- am I able to just return a single value of 60 for that field, being the sum of the 4 totals.

Can anyone point me in the right direction, based on the code above.

Thanks in advance.
  • Hi folks,
    I'm also new here with the same issue. Thanks in advance for your help.