A
AkAlan via AccessMonster.com
I need to create a monthly report that calculates the number of inspections
that were due and the number that were submited on time/late. I was doing
fine until my user told me that if an inspection was due on a weekend or
holiday that it was ok to inspect it on the following non weekend/holiday day.
I created a recordset for the months data and have the following code which
works fine:
While Not rst.EOF
If IsNull(rst![DateInspected]) Or (rst![DateInspected] > rst![DateDue])
Then
intLate = intLate + 1
Else
intOnTime = intOnTime + 1
End If
rst.MoveNext
Wend
Me.txtInspectionLate = intLate
Me.txtInspectionOnTime = intOnTime
I have a table with all the holiday dates and I think I have an idea of how
to loop through and get what I need but was looking for any hints first or
maybe someone has already done this and would share the code. Thanks for any
help.
that were due and the number that were submited on time/late. I was doing
fine until my user told me that if an inspection was due on a weekend or
holiday that it was ok to inspect it on the following non weekend/holiday day.
I created a recordset for the months data and have the following code which
works fine:
While Not rst.EOF
If IsNull(rst![DateInspected]) Or (rst![DateInspected] > rst![DateDue])
Then
intLate = intLate + 1
Else
intOnTime = intOnTime + 1
End If
rst.MoveNext
Wend
Me.txtInspectionLate = intLate
Me.txtInspectionOnTime = intOnTime
I have a table with all the holiday dates and I think I have an idea of how
to loop through and get what I need but was looking for any hints first or
maybe someone has already done this and would share the code. Thanks for any
help.