Hi
I have 2 fields in a table: StartDate, EndDate
and need to make a chart:
count records where the diff between the dates:
0-10 days
11-20 days
.
.
>365 days
A Starting point:
SELECT Int((EndDate-StartDate)/10) As Decade, Count(*)
FROM YourTable
WHERE EndDate<=StartDate+369
GROUP BY Int((EndDate-StartDate)/10)
UNION SELECT 99, Count(*)
FROM YourTable
WHERE EndDate>StartDate+369
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.