D
dazoloko via AccessMonster.com
Dear All
I sent in this post a little while ago :-
I have a field which contains a due date for an inspection. This date can be
between now and a year from now.
Where I want to get to is to create a report that basically looks at Todays
date and counts week by week the number of inspections due in each week.
And got this response :- (from John Spencer)
SELECT Format([DueDate],"yyyy-ww") as WeekID
, Count([DueDate]) as CountDue
FROM [Some table]
GROUP BY Format([DueDate],"yyyy-ww")
Or you could use
SELECT DateDiff("ww",Date(),[DueDate]) as WeeksinFuture
, Count([DueDate]) as CountDue
FROM [Some table]
GROUP BY DateDiff("ww",Date(),[DueDate])
It does what I wanted it to do but now I want to take it a step further if
possible. I have tried but find myself at a loss.
I want to be able to alter the query so it shows the only the 52 weeks from
week beginning the following Monday including the weeks where there are no
due dates as a 0.
Hope this makes sense.
Cheers
D
I sent in this post a little while ago :-
I have a field which contains a due date for an inspection. This date can be
between now and a year from now.
Where I want to get to is to create a report that basically looks at Todays
date and counts week by week the number of inspections due in each week.
And got this response :- (from John Spencer)
SELECT Format([DueDate],"yyyy-ww") as WeekID
, Count([DueDate]) as CountDue
FROM [Some table]
GROUP BY Format([DueDate],"yyyy-ww")
Or you could use
SELECT DateDiff("ww",Date(),[DueDate]) as WeeksinFuture
, Count([DueDate]) as CountDue
FROM [Some table]
GROUP BY DateDiff("ww",Date(),[DueDate])
It does what I wanted it to do but now I want to take it a step further if
possible. I have tried but find myself at a loss.
I want to be able to alter the query so it shows the only the 52 weeks from
week beginning the following Monday including the weeks where there are no
due dates as a 0.
Hope this makes sense.
Cheers
D