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
 Transact-SQL (2000)
 xp_sendmail

Author  Topic 

vijmeena
Starting Member

10 Posts

Posted - 2002-07-26 : 00:54:09
I want to use the query option in XP_sendmail to send the results of the query. How can I send the subtotals at the end of each criteria.
For e.g.

Region Code Name Amount
R01 1 Sita 100
R01 2 Geeta 500

Total - 600

R02 1 Reena 200
R02 2 Deena 400
R02 3 Lata 300

Total - 900

dsdeming

479 Posts

Posted - 2002-07-26 : 08:23:05
This seems to be more a query question that one about xp_sendmail. If you want to get subtotals out of a simple query, I suspect that WITH ROLLUP is the best you're going to do. See Summarizing Data Using ROLLUP in BOL.

Go to Top of Page
   

- Advertisement -