Question about Query Possibilities?
Hey Access gurus:
I manage a time tracking tool for my organization. I'm trying to create a query that will tell me the number of times in a month that someone failed to report their time. Now, I have a function that will tell me the number of net working days in a month (which reduces 31 days for July down to 22 days) and then I use the function in my query to tell me the capacity hours for a month. I'm thinking that maybe that function would be useful in conjunction with counting the days that someone didn't report their time but I'm not sure how I could make that work... just a thought so far.
Here are the fields that I would use in my query. UserID, Date, Hours. If no time was reported on a certain day, the field would be blank.
The function that I use to count net working days is:
HTML Code:
Function NetWorkDays(STARTDATE As Date, ENDDATE As Date) As Integer
Dim TESTDATE As Date
NetWorkDays = 0
TESTDATE = STARTDATE
While TESTDATE <= ENDDATE
If Not ((Weekday(TESTDATE) = 7) Or (Weekday(TESTDATE) = 1)) Then
NetWorkDays = NetWorkDays + 1
End If
TESTDATE = TESTDATE + 1
Wend
End Function
I've played around with creating a crosstab query where User is the Row Heading, Date is the Column Heading, and Hours is the Value. It's nice to visually see the dates across the time and the hours reported or not reported but I'd like to be able to count the times hours weren't reported. I'm totally lost on how I can make this work... can I use the count function in the crosstab query?