I would like to chart the number of times a page has been view for the past 40 days.
Whenever the page gets a hit, a timestamp is recorded for that page.
The following query returns all the hits in the past 40 days (statDuration):
This query does a great job at returning all the hits for the past 40 days, but I have two problems:
1. Some days a page is viewed more than one time, how do I extract the total times it was view for that day?
2. Some days a page might not be viewed at all, how do I provide a zero for my chart if that day does not exist and I want to show each of the past 40 days?
Whenever the page gets a hit, a timestamp is recorded for that page.
The following query returns all the hits in the past 40 days (statDuration):
Code:
SELECT *
FROM Stats
WHERE ListingFk = #URL.ad# AND DATE(timeStampStats) > #statDuration#
ORDER BY timeStampStats DESC
This query does a great job at returning all the hits for the past 40 days, but I have two problems:
1. Some days a page is viewed more than one time, how do I extract the total times it was view for that day?
2. Some days a page might not be viewed at all, how do I provide a zero for my chart if that day does not exist and I want to show each of the past 40 days?