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

How to count total at a cursor field?

Status
Not open for further replies.

paispatin

Technical User
Oct 21, 2003
62
A1
Dear all,

I have a cursor like this :

mycursor field : code, description, amount

How do I counting amount total at mycursor with SELECT SQL?

Thank you in advance
 
I think you want the total value of the amount fields, if I have understood correctly

You could use :

select sum(amount) from mycursor into cursor mytotal

It will create a cursor with a single field with the total amount.

or for a specific code

select sum(amount) from mycursor where code = 'somecode' into cursor mytotal

HTH




 
Yes, right. This is what I want.
Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top