diff --git a/access-add-in/ACLibFilterFormWizard.accda b/access-add-in/ACLibFilterFormWizard.accda index aa0a39b..749e95a 100644 Binary files a/access-add-in/ACLibFilterFormWizard.accda and b/access-add-in/ACLibFilterFormWizard.accda differ diff --git a/source/_config_Application.bas b/source/_config_Application.bas index 5137fa6..679a128 100644 --- a/source/_config_Application.bas +++ b/source/_config_Application.bas @@ -31,7 +31,7 @@ Option Explicit Option Private Module 'Version -Private Const APPLICATION_VERSION As String = "1.8.3" '2024-01 +Private Const APPLICATION_VERSION As String = "1.8.4" '2024-01 #Const USE_CLASS_APPLICATIONHANDLER_APPFILE = 1 #Const USE_CLASS_APPLICATIONHANDLER_VERSION = 1 diff --git a/source/codelib/data/SqlTools.cls b/source/codelib/data/SqlTools.cls index e29c4cf..d054208 100644 --- a/source/codelib/data/SqlTools.cls +++ b/source/codelib/data/SqlTools.cls @@ -319,7 +319,7 @@ Public Function BuildCriteria(ByVal FieldName As String, ByVal FieldDataType As 'Special cases (part 2): If Not IsArray(FilterValue) Then - If FieldDataType = SQL_Numeric Then + If FieldDataType = SQL_Numeric Or FieldDataType = SQL_Date Then If FilterValue = "*" And RelationalOperator = SQL_Equal Then BuildCriteria = BuildCriteria(FieldName, FieldDataType, SQL_Not, Null, Null, 0, True) @@ -354,7 +354,7 @@ Public Function BuildCriteria(ByVal FieldName As String, ByVal FieldDataType As Exit Function End If - If (RelationalOperator And SQL_Like) = SQL_Like Then + If (RelationalOperator And SQL_Like) = SQL_Like Or (RelationalOperator And SQL_UseLikeBehavior) = SQL_UseLikeBehavior Then If SqlWildCardString <> "*" Then If InStr(1, FilterValue, "*") > 0 Then FilterValue = Replace(FilterValue, "[*]", "@@@|||STAR|||@@@") @@ -372,7 +372,7 @@ Public Function BuildCriteria(ByVal FieldName As String, ByVal FieldDataType As End If If (RelationalOperator And SQL_Add_WildCardPrefix) = SQL_Add_WildCardPrefix Then - If (RelationalOperator And SQL_Like) = SQL_Like Then + If (RelationalOperator And SQL_Like) = SQL_Like Or (RelationalOperator And SQL_UseLikeBehavior) = SQL_UseLikeBehavior Then FilterValue = SqlWildCardString & FilterValue End If End If @@ -798,9 +798,9 @@ Private Function TryBuildWildCardSuffixOrPreBuildParams(ByVal FieldName As Strin Dim Criteria1 As String Dim Criteria2 As String - If (RelationalOperator And SQL_Like) = SQL_Like Then + If (RelationalOperator And SQL_Like) = SQL_Like Or (RelationalOperator And SQL_UseLikeBehavior) = SQL_UseLikeBehavior Then FilterValue = FilterValue & SqlWildCardString - ElseIf (FieldDataType And SQL_Date) = SQL_Date Then + ElseIf FieldDataType = SQL_Date Then If (RelationalOperator And SQL_LessThan) = 0 Then ' no < therefore: >, >= or only = If (RelationalOperator And SQL_GreaterThan) = SQL_GreaterThan Then ' change nothing ... >= DataValue / SQL_Add_WildCardSuffix is not logical @@ -817,7 +817,7 @@ Private Function TryBuildWildCardSuffixOrPreBuildParams(ByVal FieldName As Strin End If FilterValue = DateAdd("d", 1, CDate(CLng(FilterValue))) End If - ElseIf (FieldDataType And SQL_Numeric) = SQL_Numeric Then + ElseIf FieldDataType = SQL_Numeric Then If (RelationalOperator And SQL_LessThan) = 0 Then ' no < daher: >, >= or only = If (RelationalOperator And SQL_GreaterThan) = SQL_GreaterThan Then If FilterValue Like "*[,.]*[*]" Then @@ -865,8 +865,10 @@ Private Function TryBuildNumericSpecialCasesCriteria(ByRef FieldName As String, Const FilterValue2 As Variant = Null - FilterValue = Trim(FilterValue) - + If VarType(FilterValue) = vbString Then + FilterValue = Trim(FilterValue) + End If + If FilterValue Like "[0-9]*..*[0-9]*" Or FilterValue Like "[+-][0-9]*..*[0-9]*" Then TempArr = Split(FilterValue, "..") Criteria = BuildCriteria(FieldName, FieldDataType, SQL_Between, Trim(TempArr(0)), Trim(TempArr(1)), IgnoreValue, DisableIgnoreNullValue)