Available in: Logi Info | Source code name: SqlCompareFilter |
In cases in which performance is most important, one or more SqlCompareFilter element may be added as children to compare and evaluate data values. The SqlCompareFilter is often easier to use than a large SqlConditionFilter. First, add child SqlCompareFilter elements that return True or False depending on data values. Then write the Condition so it uses just ANDs, ORs and parentheses, and @Compare tokens that match the IDs of SqlCompareFilter elements.
Example with just SQL condition, without SqlCompareFilters: SqlExpression = "@Data.Freight~ > 50 AND ('@Data.CustomerID~' = 'HANAR' OR '@Data.CustomerID~' = 'MAGAA') " Example with SqlCompareFilters: Condition = "@Compare.compareFreight~ AND (@Compare.compareCustomer1~ OR @Compare.compareCustomer2~) " <SqlCompareFilter ID="compareFreight" DataColumn="Freight" CompareType=">" CompareValue="50" /> <SqlCompareFilter ID="compareCustomer1" DataColumn="CustomerID" CompareType="=" CompareValue="HANAR" /> <SqlCompareFilter ID="compareCustomer2" DataColumn="CustomerID" CompareType="=" CompareValue="MAGAA" />
CompareTypes:
=,<,>,<=,>=,!= Basic comparison operations.
Between The CompareValue must include two pipe ("|")separated numeric or date values. Rows with column values equal to or within the range remain.
Contains Rows with DataColumns containing the CompareValue string value remain.
InYear, InMonth, InQuarter, InWeek and InDay match when the dates being compared are within the same time-span.
InList DataColumn values that match an item in a comma-delimited list.
NotContains Rows with column values that do not contain the CompareValue remain.
NotInList DataColumn values that do not match any item of a comma-delimited list.
NotStartsWith DataColumn values that do not start with the CompareValue remain.
StartsWith DataColumn values that start with the CompareValue remain.
|