Microsoft
Software
Hardware
Network
Question : Excel SQL Subtotal
I am using Excel to connect to an MSSQL database. Specifically, I am using the Excel function: Data / Import External Data / New Database Query.
I am able to successfully get the information I want, but I would like to know how to subtotal by category. So in my case, my query generates the following SQL statement:
SELECT Patient."Last Name", Patient."First Name", Patient."Last Visit", Patient."Provider Code", Patient."Facility Code"
FROM "Sample Company".dbo.Patient Patient
ORDER BY Patient."Facility Code", Patient."Provider Code", Patient."Last Name"
This gives me a nice long spreadsheet sorted by Facility. Is there a way to subtotal the Count of each unique value in the Facility column?
Answer : Excel SQL Subtotal
Once you get back the query results, then, you can use Excel's subtotals feature.
In Excel 2003 it was under either Insert or Data (can't check now); in Excel 2007 it's on the Data tab, Outline group.
Random Solutions
Microsoft Clustering on VMWare ESX 4
Why are clients unable to login when one DC is powered off?
How do I keep the jQuery Accordion from touching the footer-especially IE7?
pros and cons of GWT
What processor do I need for my Dell Latitude 620
Remote Desktop Server 2003 Group Policy and Server 2008
firefox and thunderbird displaying text/font funny
Populate value for the first item
Sharepoint, SQL and IIS setup
What is the DOS command to create a text file of the directory of a folder?