Calculating Aggregate Total in A Select Query Which Has 1 Grouped Field and 1 Summed Field

Galapagos15

Board Regular
Joined
Sep 16, 2015
Messages
100
If I have a select query which groups "Company" and sums the "Blled Amt" how can I make an aggregate "Total" show in my results when the query is run? For example, I would want the $60 aggregate total to show when the query is run?

SQL Coding:

SELECT Table1.[Company], Sum(Table1.[Billed Amt]) AS [SumOfBilled Amt]
FROM Table1
GROUP BY Table1.[Company];


Current Results:

Company_______________SumOf BILLED AMT
C&O_______________________$10
Barner_____________________$20
Granger____________________$30

Desired Results:

Company_______________SumOf BILLED AMT
C&O_______________________$10
Barner_____________________$20
Granger____________________$30
Total-______________________$60
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
.1. open the datasheet
.2. click the Totals icon on the HOME ribbon in the Records group
.3. this adds another row to the bottom labeled "Total"
.4. click the Total cell in the Sum column and choose "Sum" from the dropdown list
 
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,252
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top