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

diplaying Data from a stored procedure

Status
Not open for further replies.

jcook32

Programmer
Jun 11, 2003
20
US
I have a stored proc. that returns a bunch or records. There is a col. called head1. there are 5 different departs in head1 I need to display each department once and give running totals of other columns.
ex there is say 100 records with the head1 as Litiagation with each row have some numbers. I want to display Litigation once and give the total of all the numbers. then move on to the next dept head.

Help!!
thanks

joe
 
Code:
select head1,sum(numbers) from t
group by head1

It is better if you describe the tables, gives some sample data and the expected result. Now I need to guess about cthe names involved.
 

Litigation 7029.05 0 0 0 0 7029.05


Litigation 0 0 0 0 148618.679 148618.679


Litigation 0 21615.14 0 0 0 21615.14


Litigation 0 0 0 0 47843.7464 47843.7464


Litigation 0 0 0 0 2630.25 2630.25


Litigation 5860.91 0 0 0 0 5860.91


above a several rows of data the is returned from the stored procedure. I need to combine the rows that have litigation in to one and each col of numbers have to be totaled up. I have a record set that I call rs and right now i just loop through until eof and display all the records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top