Toad World® Forums

automating a query with a grand total


#1

Hello -

I have a query that I have automated and export in excel. I would like it to export with a grand total on the currency columns. I’ve look online on how to create grand totals in SQL and a “ROLLUP” is used often, but I can’t get it to work within TOAD. Any tricks you might have on creating a grand total on a query in TDA?

Thanks.


#2

I find using Pivot Grids for this are much easier. There is a separate Pivot Grid report that can be refreshed in automation or you can add a pivot grid to a Toad Report. To experiment with pivots just use the pivot tab in the Query Builder or Editor. Then when you have what you need, right click on the result set and use the ‘Send To | Pivot Grid’. This window is quite nice for totals but also rolling up date ranges IE: Quarters, weeks, etc.

If you want to work on the use of ROLLUP, execute the SQL you are experimenting with in the editor and save the SQL and result set as a Toad Editor File (Extension *.tef) and send to me.

Debbie


#3

Thanks. I’ll give the grid a try.