Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL output / grouping / subtotal question

Status
Not open for further replies.

drStealth

Programmer
Dec 26, 2001
22
US
Hello everyone,

This seems straightforward enough but I'm having a difficult time getting this to work...

We have SQL views and stored procedures which feed a MS-Access report. The report groups totals and gives the percentage of each item's total relative to the group total. Example:

Total for Group : 10
Total for Item A....2 100% of group total
Total for Item B....8 100% of group total

Everything works except for the % of group total. I cannot seem to get SQL to use the group total of 10 to perform this computation. Each one is 100% instead of 20% and 80% respectively. I have tried renaming the calculated total but that has not worked. I am obviously missing something or the logic is not quite right. Any thoughts would be appreciated. Thanks. drStealth

 

Could you post your T-SQL code so we can get an idea of what it does currently? Thanks. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top