next2heaven — 2010-01-05T11:08:46-05:00 — #1
I'm working with charts in Flash and need to create an xml file that will store the data for Flash to access. I was wondering if there was an easy way to do this:
I want 1 query that will count totals from one date to another. So something like this:
6/09 - 125
6/10 - 55
6/11 - 0
6/12 - 15
6/13 - 581
6/14 - 33
I know I could just do 7 queries but if the date range is a lot higher I could end up doing a ton of queries.
So I was just wondering if anyone had a solution to returning that information in 1 query.
dan_grossman — 2010-01-05T13:27:09-05:00 — #2
Select the count of rows grouped by date, for all rows in your date range. That will give you one row per day. You'll then write a couple lines of code in your application to do the addition to get the totals in the format you want.
next2heaven — 2010-01-05T14:29:30-05:00 — #3
I see....so have the application fill in any gaps. That works. Thanks.