Hi,
I'm trying to identify applications which have been in the system from more than x days but not responded to, x being variable and entered onto a user form.
I'm trying to calculate working days between 2 dates, using this function;
Public Function WorkingDays(FromDate As Date, UntilDate As Date) As Integer
If IsNull(FromDate) Or IsNull(UntilDate) Then
WorkingDays = 0
Exit Function
End If
If UntilDate <= FromDate Then
WorkingDays = 1
Else
WorkingDays = WeekDays(FromDate, UntilDate) - Holidays(FromDate, UntilDate)
End If
End Function
Weekdays and Holidays functions have been defined.
My Query field is TimeTaken: WorkingDays([RECPTD],[DATE()])
in the criteria box I have >([Forms]![frmMainMenu]![NoOfDays])
When I run the query I get prompted to enter parameter value DATE(). I just can't figure this one out, any help would be appreciated,
Thanks
FrankyG
I'm trying to identify applications which have been in the system from more than x days but not responded to, x being variable and entered onto a user form.
I'm trying to calculate working days between 2 dates, using this function;
Public Function WorkingDays(FromDate As Date, UntilDate As Date) As Integer
If IsNull(FromDate) Or IsNull(UntilDate) Then
WorkingDays = 0
Exit Function
End If
If UntilDate <= FromDate Then
WorkingDays = 1
Else
WorkingDays = WeekDays(FromDate, UntilDate) - Holidays(FromDate, UntilDate)
End If
End Function
Weekdays and Holidays functions have been defined.
My Query field is TimeTaken: WorkingDays([RECPTD],[DATE()])
in the criteria box I have >([Forms]![frmMainMenu]![NoOfDays])
When I run the query I get prompted to enter parameter value DATE(). I just can't figure this one out, any help would be appreciated,
Thanks
FrankyG