Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to display SQL compute value
Message
From
05/11/1999 04:32:22
 
 
To
All
General information
Forum:
Visual C++
Category:
Other
Title:
How to display SQL compute value
Miscellaneous
Thread ID:
00287364
Message ID:
00287364
Views:
57
I have a table which I would like to display along with the sum of certain columns:

office code amnt
------ ---- ------

manila 1000 12
manila 1000 22
manila 1001 24
manila 1000 53

i have this code:
< %
qry = "select office,code,'ntotal' = sum(amnt) from web_test where"
qry = qry & " office = 'manila' group by office, code"
qry = qry & " order by office, code compute sum(sum(amnt))"
Response.Write qry
set rs = server.createobject("ADODB.Recordset")
rs.open qry,"DSN=cmts_sql;UID=sa"

while not rs.EOF

Response . Write rs("office") & " " & rs("code") & " " & rs("ntotal") & " < br > "
rs.MoveNext

wend

% >

This results in:

manila 1000 87
manila 1001 24

But this does not display the compute sum(sum(amnt)). How do i display it? I plan to use that sum(sum(amnt)) and assign it to a variable because the table is going to be very long (about 100,000 records). I plan to use ADO's pagecount,pagesize properties to display the contents of the table in pages and at the same time displaying the subtotal and grandtotal of amnt always.

Thanks for the help :)

Ramon Carlos
Reply
Map
View

Click here to load this message in the networking platform