Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003

    Unanswered: Group By Date Range

    I have the following sql query which I would like to group by date range in weeks. It is a table that records ipAddresses for various pages. I am trying to return total and distinct page hits per week.

    SELECT page, count(*) AS total, count(DISTINCT ipAddress) AS ipAddress
    FROM tblUniquePageHits
    date_hit >= '2003-09-03 10:00:00' AND
    date_hit < '2003-10-17 10:00:00' AND
    page = 'Main'
    GROUP BY page

    I want to group by date_hit from
    '2003-09-03 10:00:00' to '2003-09-10 10:00:00'
    '2003-09-10 10:00:00' to '2003-09-17 10:00:00'
    and so on....

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    see if this article might help you --

    Aggregates for date ranges
    (registration required, but it's free)

    if you have any questions, let me know


Posting Permissions

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