zelarra821
Registered User.
- Local time
- Today, 20:25
- Joined
- Jan 14, 2019
- Messages
- 809
Good Morning.
I have a problem searching in a date range. To do this, I use this function that @MajP created for me:
If I search between two dates, the first one does include it, but the second does not.
However, if I change between to this:
He does the same to me.
I have to say that I am searching between two dates which I know for a fact that there are records in the extremes in which I am searching.
Does anyone know how I can fix it?
Thank you.
I have a problem searching in a date range. To do this, I use this function that @MajP created for me:
Code:
Public Function GetBetweenFilter(Ctrl1 As Access.Control, ctrl2 As Access.Control, TheFieldName As String, Optional TheSql_Datatype As SQL_DataType = sdt_date) As String
Dim val1 As String
Dim val2 As String
If Not IsNull(Ctrl1) And Not IsNull(ctrl2) Then
val1 = CSql(Ctrl1, TheSql_Datatype)
val2 = CSql(ctrl2, TheSql_Datatype)
GetBetweenFilter = TheFieldName & " BETWEEN " & val1 & " AND " & val2
End If
End Function
If I search between two dates, the first one does include it, but the second does not.
However, if I change between to this:
Code:
GetBetweenFilter = TheFieldName & ">=" & val1 & " AND " & TheFieldName & "<=" & val2
He does the same to me.
I have to say that I am searching between two dates which I know for a fact that there are records in the extremes in which I am searching.
Does anyone know how I can fix it?
Thank you.