SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict next2heaven's Avatar
    Join Date
    Apr 2005
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Return date range of information

    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.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #3
    SitePoint Addict next2heaven's Avatar
    Join Date
    Apr 2005
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see....so have the application fill in any gaps. That works. Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •