Newbie question on insert summary rows into dataset

D

Danny Ni

Hi,

Is there a way to insert summary rows into a dataset or datareader without
actually save them back to the SQL server?

I have a resultset returned by SQL server using the following SQL statement:
select gid, eid, wdate, whours from timelog order by gid, eid, wdate

I like to insert a summary row for every eid and gid.
For example, the following dataset or datareader:
gid eid wdate whours
------------------------------------
1 101 1/1/04 8
1 101 1/2/04 8
1 102 1/1/04 7.5
1 102 1/2/04 6.5

will become
gid eid wdate whours
------------------------------------
1 101 1/1/04 8
1 101 1/2/04 8
1 101 null 16
1 102 1/1/04 7.5
1 102 1/2/04 6.5
1 102 null 14
1 null null 20

Thanks in Advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top