chayes1964
Technical User
I used this simple code to calculate the difference between the current date and another date for several records in an Access table:
Option Explicit
Function GetElapsedDays(interval)
Dim days As Long
days = Int(CSng(interval))
GetElapsedDays = days & " Days"
End Function
This works fine. However, my problem comes while working at the query level. I get datatype mismatch error when attempting to place limits on the results (i.e., when trying to retrieve all records where the elapsed number of days is greater than 20 days). Any suggestions on the proper formatting of criteria for the results of this date query?
Option Explicit
Function GetElapsedDays(interval)
Dim days As Long
days = Int(CSng(interval))
GetElapsedDays = days & " Days"
End Function
This works fine. However, my problem comes while working at the query level. I get datatype mismatch error when attempting to place limits on the results (i.e., when trying to retrieve all records where the elapsed number of days is greater than 20 days). Any suggestions on the proper formatting of criteria for the results of this date query?