Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Can i get the result of the 'Compute' Clause in the recordset

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-05 : 09:30:05
Shubs writes "I have this following query:
SELECT cr.aogl, tot = sum(cr.aobalance)
from car_ori cr, cbaname c
where cr.aogl = c.glslcd
group by cr.aogl
order by cr.aogl
compute sum(sum(cr.aobalance))
** here the compute sum(tot) gives an error that--> Invalid column name 'tot'.

Now the result is as follows:
aogl tot
------ -----------------------------------------------------
ABD01 1227981.54
AGR11 165109.22

sum
=====================================================
1393090.76

(2 row(s) affected)

The grand sum (1393090.76) is not a part of the recordset... but i want this as an output in the front end... i m using asp for this. What sql query do i write?"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-06-05 : 09:31:03
http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=15742

Go to Top of Page
   

- Advertisement -