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 2012 Forums
 Transact-SQL (2012)
 grand total and rollup , GP to blank space

Author  Topic 

usafelix
Posting Yak Master

165 Posts

Posted - 2014-08-13 : 00:14:02
Urgent help !
I want to write a query to change the last record is show to grand total. how I can use the shop code is null and display the "Total" and
not display zero in GP% ?
this 10631.7 is used by rollup to display.

Sales date shop GP% amount
20140813 KC001 4.000000 102.00
20140813 LM001 54.000000 1697.50
20140813 MC001 55.000000 684.00
20140813 MK002 49.000000 1413.30
20140813 NP002 70.000000 395.30
20140813 TM002 47.000000 1983.30
20140813 TM003 64.000000 698.90
20140813 TS001 44.000000 225.90
20140813 TW003 26.000000 21.80
20140813 WC002 53.000000 1962.80
20140813 YL002 56.000000 1446.90
20140813 null 53.000000 10631.70

robbie2883
Starting Member

2 Posts

Posted - 2014-08-16 : 00:24:14
you could pull your results and then union the select and sum the columns
Go to Top of Page
   

- Advertisement -