Mark
The following works in Database Desktop (v7.0) -
haven't verified how it goes in Delphi.
Table has Amount and ExpType (among other things)
in an Expenses table. The following SQL provides total expenses by type and as
percentage of total and has a grand total at the end.
select "zzzzzz", sum(amount), 100 from expenses
e3
union select exptype, sum(amount), (sum(amount)/(select sum(amount) from expenses e2) * 100) from expenses e1 group by exptype The "zzzzzz" (in my query) managed to put that line
(grand total) at the end - it could be a column you don't show in the
report.
The 100 in first select sets up the column - and
ensures percentages add up to 100 at the end <g>.
HTH
Mike
|
- [DUG]: Paradox SQL - Group totals as % of Grand total Mark Howard
- Re: [DUG]: Paradox SQL - Group totals as % of Grand ... Craig Goodall
- RE: [DUG]: Paradox SQL - Group totals as % of Grand ... Stacey Verner
- Re: [DUG]: Paradox SQL - Group totals as % of Grand ... Trevor Jones
- Re: [DUG]: Paradox SQL - Group totals as % of Grand ... Mike Osborne
- RE: [DUG]: Paradox SQL - Group totals as % of Grand ... Cheng Wei (ASL)
- Re: [DUG]: Paradox SQL - Group totals as % of Grand ... Mark Howard
- Re: [DUG]: Paradox SQL - Group totals as % of Grand ... Trevor Jones
- RE: [DUG]: Paradox SQL - Group totals as % of Grand ... Cheng Wei (ASL)