Last post May 27, 2020 01:53 PM by mrwww76
Member
140 Points
518 Posts
May 27, 2020 07:12 AM|jsshivalik|LINK
Hi
I want to display Subtotal by P.O # & ItemCode
Thanks
Participant
1120 Points
296 Posts
May 27, 2020 11:03 AM|imapsp|LINK
Hi,
Try something like this:
select [PO], [Vendor], [VendorRef], [ItemCode], [ItemDescription], sum([POQty]) as POQty, [POPrice], [RecdQty] from MyTable group by grouping sets ( ( [PO], [Vendor], [VendorRef], [ItemCode], [ItemDescription], [POQty], [POPrice], [RecdQty] ), ( [PO], [ItemCode] ) )
Hope this help
31 Points
49 Posts
May 27, 2020 01:53 PM|mrwww76|LINK
You can also try:
select distinct [PO], [Vendor], [VendorRef], [ItemCode], [ItemDescription], sum([POQty]) over(partition by [PO], [ItemCode]) as POQty, [POPrice], [RecdQty] from MyTable
Member
140 Points
518 Posts
SubTotals
May 27, 2020 07:12 AM|jsshivalik|LINK
Hi
I want to display Subtotal by P.O # & ItemCode
Thanks
Participant
1120 Points
296 Posts
Re: SubTotals
May 27, 2020 11:03 AM|imapsp|LINK
Hi,
Try something like this:
Hope this help
Member
31 Points
49 Posts
Re: SubTotals
May 27, 2020 01:53 PM|mrwww76|LINK
You can also try: