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 2005 Forums
 Transact-SQL (2005)
 Need to show Sub Totals

Author  Topic 

mummy
Starting Member

9 Posts

Posted - 2009-03-24 : 04:22:46
Hi

i would like to show the sub totals, for example my table is like this:

Head_____Currency_____FirstClsass____SecondClass____Predict__
---------------------------------------------------------------
1__________USD___________10.25_________8.75___________P_______
1.1________USD___________11.25_________10.75__________P_______
1.2________USD___________20.55_________19.55__________U_______
2__________USD___________12.35_________8.95___________P_______
2.1________USD___________14.55_________9.95___________P_______
2.1.1______USD___________15.35_________9.95___________U_______

I would like to show the sub totals as below:

Head_____Currency_____FirstClsass____SecondClass____Predict__
---------------------------------------------------------------
1__________USD___________10.25_________8.75___________P_______
1.1________USD___________11.25_________10.75__________P_______
1.2________USD___________20.55_________19.55__________U_______
Ptot1______USD___________21.50_________19.50__________P_______
Utot1______USD___________20.55_________19.55__________U_______

2__________USD___________12.35_________8.95___________P_______
2.1________USD___________14.55_________9.95___________P_______
2.1.1______USD___________15.35_________9.95___________U_______
Ptot2______USD___________26.90_________18.90__________P_______
Utot2______USD___________15.35_________9.95__________U_______


Kindly assist me to show the result as above.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-03-24 : 05:27:44
IMHO:
If you are using a reporting frontend then you do it better there.

Greetings
Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

mummy
Starting Member

9 Posts

Posted - 2009-03-30 : 07:58:26
Hi,

I am not using report front end. I just want to show the results with sub totals as i mentioned. Can anyone please help.

Thanks.
Go to Top of Page
   

- Advertisement -