i have a page that displays the last 5, 10 or 20 days of sales. the statement looks like this:
the resulting table looks like this when date_range = 5:
SELECT TOP "+date_range+" SalesDate, SUM(DailySales) AS total_sales
GROUP BY SalesDate
ORDER BY SalesDate DESC
the problem is that i also want to display the sum of each day's total_sales. any ideas??? i've tried including a subquery, but that doesn't allow me to sum up group calculations...tia!