I am getting "Data type mismatch in criteria expression" error with the following query and module:
Query Expression:
Age: Max(IIf(fDetermineAging(tblIST!SODate)>30,"Over 30",IIf(fDetermineAging(tblIST!SODate)>20,"21-30",IIf(fDetermineAging(tblIST!SODate)>10,"11-20","0-10"))))
Module fDetermineAging:
Public Function fDetermineAging(ByVal SODate As Date) As Integer
Dim iDte As Integer
Dim iAge As Integer
iDte = 0
iAge = 0
While SODate + iDte < Date
If OffDays(SODate + iDte) = False Then
iAge = iAge + 1
End If
iDte = iDte + 1
Wend
fDetermineAging = iAge
End Function
SODate is Date/Time field type in table.
ANY help would be greatly appreciated.
Query Expression:
Age: Max(IIf(fDetermineAging(tblIST!SODate)>30,"Over 30",IIf(fDetermineAging(tblIST!SODate)>20,"21-30",IIf(fDetermineAging(tblIST!SODate)>10,"11-20","0-10"))))
Module fDetermineAging:
Public Function fDetermineAging(ByVal SODate As Date) As Integer
Dim iDte As Integer
Dim iAge As Integer
iDte = 0
iAge = 0
While SODate + iDte < Date
If OffDays(SODate + iDte) = False Then
iAge = iAge + 1
End If
iDte = iDte + 1
Wend
fDetermineAging = iAge
End Function
SODate is Date/Time field type in table.
ANY help would be greatly appreciated.