P
Paxton
Hi,
I'm trying to display the total page views per page within a given date
range, but the correct SQL is seemingly beyond me. I get the correct result
with a straightforward Group By and Count clause eg
SELECT DISTINCT tblPageViews.PageVisited,
Count(tblPageViews.PageVisited) AS CountOfPageVisited
FROM tblPageViews
GROUP BY tblPageViews.PageVisited;
but as soon as I introduce some date criteria:
SELECT DISTINCT tblPageViews.PageVisited,
Count(tblPageViews.PageVisited) AS CountOfPageVisited
FROM tblPageViews
GROUP BY tblPageViews.PageVisited, tblPageViews.StartTime
HAVING tblPageViews.StartTime Between #11/1/2004 0:0:1# And #11/1/2004
23:59:59#;
the results change completely. For example, I know the default.asp was
viewed nearly 5000 times within the date range, but it appears twice in the
second resultset, both times with a count of 1.
Incidentally, I have taken into account that the results will differ between
the 2 examples as no criteria restrictions are placed on the first query.
Am I being idiotic in relying on Access's Query Wizard?
TIA
I'm trying to display the total page views per page within a given date
range, but the correct SQL is seemingly beyond me. I get the correct result
with a straightforward Group By and Count clause eg
SELECT DISTINCT tblPageViews.PageVisited,
Count(tblPageViews.PageVisited) AS CountOfPageVisited
FROM tblPageViews
GROUP BY tblPageViews.PageVisited;
but as soon as I introduce some date criteria:
SELECT DISTINCT tblPageViews.PageVisited,
Count(tblPageViews.PageVisited) AS CountOfPageVisited
FROM tblPageViews
GROUP BY tblPageViews.PageVisited, tblPageViews.StartTime
HAVING tblPageViews.StartTime Between #11/1/2004 0:0:1# And #11/1/2004
23:59:59#;
the results change completely. For example, I know the default.asp was
viewed nearly 5000 times within the date range, but it appears twice in the
second resultset, both times with a count of 1.
Incidentally, I have taken into account that the results will differ between
the 2 examples as no criteria restrictions are placed on the first query.
Am I being idiotic in relying on Access's Query Wizard?
TIA