Hi all,
Can some one give me a little advise or tell me why is this function can't be called from a query?
It's giving me a zero value for the whole field....
Can some one give me a little advise or tell me why is this function can't be called from a query?
It's giving me a zero value for the whole field....
Code:
Public Function Discrep_Length_Test() As Variant
If (IsNull(DMax("[ArchiveDate]", "0018 Counts Archive"))) Then
Discrep_Length_Test = DateDiff("m", DMax("[ArchiveDate]", "0016 In Bin Not Counted Archive"), DMin("[ArchiveDate]", "0016 In Bin Not Counted Archive"))
ElseIf (DMax("[ArchiveDate]", "0018 Counts Archive") > DMax("[ArchiveDate]", "0016 In Bin Not Counted Archive")) Then
Discrep_Length_Test = "Reconciled"
Else
Discrep_Length_Test = DateDiff("m", DMax("[ArchiveDate]", "0018 Counts Archive"), DMax("[ArchiveDate]", "0016 In Bin Not Counted Archive"))
End If
End Function