S
SFatz
I have a task logging database that is used by the department to track hours
spent on various assigned tasks. The database has the following fields:
UserID, LogDate, HoursLogged, and some others for detail specific data not
pertinent here.
I need a query to count how many users logged hours during each week. I can
get a list of the users by week with the following query.
SELECT DISTINCT [LogDate]-Weekday([LogDate])+7 AS WeekEndDate, UserID
FROM TaskLog
ORDER BY [LogDate]-Weekday([LogDate])+7;
( [LogDate]-Weekday([LogDate])+7 calculates the week ending date. )
This query gives me the following results.
WeekEndDate UserID
09/18/04 Alan
09/18/04 Betty
09/18/04 Colin
09/25/04 Alan
10/02/04 Colin
10/02/04 Drew
I can't seem to get a query that will give me the number of users per week
that entered something in the log. The query should provide results like
the following.
WeekEndDate UserCount
09/18/04 3
09/25/04 1
10/02/04 2
My many thanks go out in advance for your help.
spent on various assigned tasks. The database has the following fields:
UserID, LogDate, HoursLogged, and some others for detail specific data not
pertinent here.
I need a query to count how many users logged hours during each week. I can
get a list of the users by week with the following query.
SELECT DISTINCT [LogDate]-Weekday([LogDate])+7 AS WeekEndDate, UserID
FROM TaskLog
ORDER BY [LogDate]-Weekday([LogDate])+7;
( [LogDate]-Weekday([LogDate])+7 calculates the week ending date. )
This query gives me the following results.
WeekEndDate UserID
09/18/04 Alan
09/18/04 Betty
09/18/04 Colin
09/25/04 Alan
10/02/04 Colin
10/02/04 Drew
I can't seem to get a query that will give me the number of users per week
that entered something in the log. The query should provide results like
the following.
WeekEndDate UserCount
09/18/04 3
09/25/04 1
10/02/04 2
My many thanks go out in advance for your help.