S
Scott
I'm having trouble creating a function that returns the difference in 2 time
fields. Within a query, below statement returns correct time.
Duration: IIf([BeginDateTime] Is
null,"",Format([BeginDateTime]-1-[EndDateTime],"Short Time"))
Sample Record:
10:40 AM 10:45 AM = 00:05
Below is a function I'm trying to get the same functionality from, but get
errors like "object required" when testing. I think it's in my data type
declarations. Could someone tell me what I'm doing wrong?
====================================================================
Function Duration(BegDate As Variant, EndDate As Variant) As Date
If [BegDate] Is Null Then
Duration = ""
Else
Duration = Format([BegDate] - 1 - [EndDate], "Short Time")
End If
End Function
fields. Within a query, below statement returns correct time.
Duration: IIf([BeginDateTime] Is
null,"",Format([BeginDateTime]-1-[EndDateTime],"Short Time"))
Sample Record:
10:40 AM 10:45 AM = 00:05
Below is a function I'm trying to get the same functionality from, but get
errors like "object required" when testing. I think it's in my data type
declarations. Could someone tell me what I'm doing wrong?
====================================================================
Function Duration(BegDate As Variant, EndDate As Variant) As Date
If [BegDate] Is Null Then
Duration = ""
Else
Duration = Format([BegDate] - 1 - [EndDate], "Short Time")
End If
End Function