IsDateBtw




Public Function IsDateBetween(dBeginDate As Date, dEndDate As Date, dToCheck As Date) As Boolean
Dim intTotalDays As Integer
Dim i As Integer
Dim dNewDate As Date
intTotalDays = DateDiff("d", dBeginDate, dEndDate)
For i = 1 To intTotalDays
dNewDate = DateAdd("d", i, dBeginDate)
If dNewDate = dToCheck Then
IsDateBetween = True
Exit Function
End If
Next i
IsDateBetween = False
End Function

Inputs:
dBeginDate, dEndDate, dToCheck

Returns:
True if date is between or false if not











( isdatebtw.html )- by Paolo Puglisi - Modifica del 17/12/2023