I have a table with database sizes in it that tracks the size of the database for every day of the past year:
Server Database Date Size
CS1 cust 1/1/2013 1200
CS1 cust 1/2/2013 1210
CS1 prog 1/1/2013 800
CS1 prog 1/2/2013 820
CS1 cust 8/1/2013 1700
CS1 cust 8/2/2013 1800
CS1 prog 8/1/2013 1000
CS1 prog 8/2/2013 1020
I have a query that gives me the highest size per month for a specific database:
SELECT MONTH(Date) AS Month, max(Size) AS Size
WHERE Server = 'CS1'
AND Database = 'cust'
GROUP BY MONTH(Date)
ORDER BY Month DESC
But I need a query that gets me the Sum of that highest size for the server per month...
Obviously changing MAX in the above query to just SUM gets me the sum of every size and that's not what I need.
Any assistance would be appreciated.
(Sorry for the formatting, not sure how to insert table data)