Forum Moderators: open
SELECT COUNT(*) AS ct, DateIn
FROM tblInsuranceStats
WHERE (DATEDIFF(DAY, DateIn, GETDATE()) < 7)
GROUP BY DateIn
this returns the last 7 days action but it shows as
01/09/2005 13.10
01/09/2005 13.20
how can i get it to group to 01/09/2005 is the something that i could change in the default insetad of getdate()?
This now show the last 14 days of stats!
Ok moving on to my next issue.
from this query i now want to link into another page to show stast for that day!
so, link being?d=15(axample).
when on the next page the sql query to retrieve the results for day 15, i have put as :
SELECT * FROM tblInsuranceStats
WHERE
(Datepart(day,datein) = '::D::')
If i replace the '::D::' with a number it works, so it must be the '::D::' thats the problem?
Why is this not working? Any ideas?