Public Function TimeDurationAsDate(pvFrom As Variant, pvTo As Variant) As Date
Dim afError As Integer
Dim adReturn As Date
afError = 0
adReturn = 0
If Nz(pvFrom, 0) = 0 Then afError = 1
If Nz(pvTo, 0) = 0 Then afError = 1
If IsDate(pvFrom) = False Then afError = 1
If IsDate(pvTo) = False Then afError = 1
If afError = 0 Then
If pvTo < pvFrom Then
If Int(pvFrom) + Int(pvTo) = 0 Then pvTo = pvTo + 1
End If
adReturn = pvTo - pvFrom
End If
TimeDurationAdDate = adReturn
End Function
StartDateTime: [StartDate] & " " & [StartTime]
Oh man!, Mark you are a genius! it worked, left all those #Error's blank and my reports ran perfectly! I owe you a great big Steak Dinner if I ever come to Vancover!
David
Obviously I am dealing with two different Marks?? Either way, so maybe one of you that created the code to get rid of my #error, can tell my why a time to midnight (10:00pm to 12:00am) shows "0" until I put it a minute before or after to have it read the Man Hours.
If Nz(pvFrom, 0) = 0 Then afError = 1
If Nz(pvTo, 0) = 0 Then afError = 1
If IsNull(pvFrom) = True Then afError = 1
If IsNull(pvTo) =True Then afError = 1