@@ -319,7 +319,7 @@ Public Function BuildCriteria(ByVal FieldName As String, ByVal FieldDataType As
319
319
'Special cases (part 2):
320
320
If Not IsArray(FilterValue) Then
321
321
322
- If FieldDataType = SQL_Numeric Then
322
+ If FieldDataType = SQL_Numeric Or FieldDataType = SQL_Date Then
323
323
324
324
If FilterValue = "*" And RelationalOperator = SQL_Equal Then
325
325
BuildCriteria = BuildCriteria(FieldName, FieldDataType, SQL_Not, Null , Null , 0 , True )
@@ -354,7 +354,7 @@ Public Function BuildCriteria(ByVal FieldName As String, ByVal FieldDataType As
354
354
Exit Function
355
355
End If
356
356
357
- If (RelationalOperator And SQL_Like) = SQL_Like Then
357
+ If (RelationalOperator And SQL_Like) = SQL_Like Or (RelationalOperator And SQL_UseLikeBehavior) = SQL_UseLikeBehavior Then
358
358
If SqlWildCardString <> "*" Then
359
359
If InStr(1 , FilterValue, "*" ) > 0 Then
360
360
FilterValue = Replace(FilterValue, "[*]" , "@@@|||STAR|||@@@" )
@@ -372,7 +372,7 @@ Public Function BuildCriteria(ByVal FieldName As String, ByVal FieldDataType As
372
372
End If
373
373
374
374
If (RelationalOperator And SQL_Add_WildCardPrefix) = SQL_Add_WildCardPrefix Then
375
- If (RelationalOperator And SQL_Like) = SQL_Like Then
375
+ If (RelationalOperator And SQL_Like) = SQL_Like Or (RelationalOperator And SQL_UseLikeBehavior) = SQL_UseLikeBehavior Then
376
376
FilterValue = SqlWildCardString & FilterValue
377
377
End If
378
378
End If
@@ -798,9 +798,9 @@ Private Function TryBuildWildCardSuffixOrPreBuildParams(ByVal FieldName As Strin
798
798
Dim Criteria1 As String
799
799
Dim Criteria2 As String
800
800
801
- If (RelationalOperator And SQL_Like) = SQL_Like Then
801
+ If (RelationalOperator And SQL_Like) = SQL_Like Or (RelationalOperator And SQL_UseLikeBehavior) = SQL_UseLikeBehavior Then
802
802
FilterValue = FilterValue & SqlWildCardString
803
- ElseIf ( FieldDataType And SQL_Date) = SQL_Date Then
803
+ ElseIf FieldDataType = SQL_Date Then
804
804
If (RelationalOperator And SQL_LessThan) = 0 Then ' no < therefore: >, >= or only =
805
805
If (RelationalOperator And SQL_GreaterThan) = SQL_GreaterThan Then
806
806
' change nothing ... >= DataValue / SQL_Add_WildCardSuffix is not logical
@@ -817,7 +817,7 @@ Private Function TryBuildWildCardSuffixOrPreBuildParams(ByVal FieldName As Strin
817
817
End If
818
818
FilterValue = DateAdd("d" , 1 , CDate(CLng(FilterValue)))
819
819
End If
820
- ElseIf ( FieldDataType And SQL_Numeric) = SQL_Numeric Then
820
+ ElseIf FieldDataType = SQL_Numeric Then
821
821
If (RelationalOperator And SQL_LessThan) = 0 Then ' no < daher: >, >= or only =
822
822
If (RelationalOperator And SQL_GreaterThan) = SQL_GreaterThan Then
823
823
If FilterValue Like "*[,.]*[*]" Then
@@ -865,8 +865,10 @@ Private Function TryBuildNumericSpecialCasesCriteria(ByRef FieldName As String,
865
865
866
866
Const FilterValue2 As Variant = Null
867
867
868
- FilterValue = Trim(FilterValue)
869
-
868
+ If VarType(FilterValue) = vbString Then
869
+ FilterValue = Trim(FilterValue)
870
+ End If
871
+
870
872
If FilterValue Like "[0-9]*..*[0-9]*" Or FilterValue Like "[+-][0-9]*..*[0-9]*" Then
871
873
TempArr = Split(FilterValue, ".." )
872
874
Criteria = BuildCriteria(FieldName, FieldDataType, SQL_Between, Trim(TempArr(0 )), Trim(TempArr(1 )), IgnoreValue, DisableIgnoreNullValue)
0 commit comments