Booleans
Here are some examples that couple simple queries with Boolean processing.
Find documents with (any of the order_origin field values of ‘London’, ‘LA’ or ‘Tokyo’ AND sales
date greater than 11 May 11 2016) OR having Part number of
388388:
Order_origin in (‘London’, ‘LA’, ‘Tokyo’) AND date_origin > @dt(‘20160511’) OR
partno = 388388
Find documents with values of ‘Shipping’ using the Status column in the ‘Soon to be special’ view
AND with either an order_origin of ‘LA’ OR sold by any of Chad Keighley, Jeff Chantel, Louis
Cawlfield or Mariel
Nathanson:
'Soon to be special’.Status = ‘Shipping’ AND
( order_origin = ‘LA’ OR
sales_person in (‘Chad Keighley’, ‘Jeff Chantel’, ‘Louis Cawlfield’, ‘Mariel Nathanson’))**
Find documents with values of ‘Inventory’ using the Status column in the ‘Soon to be special’
view AND with either an order_origin of ‘Detroit’ OR NOT sold by any of Harold Cunningham, Julie
Leach, Gordon Smith of Terence
Henry:
‘Soon to be special’.Status = ‘Inventory’ AND
( order_origin = ‘Detroit’ OR
NOT sales_person in (‘Harold Cunningham’, ‘Julie Leach’, ‘Gordon Smith’, ‘Terence Henry’))
Note:
DQL does not support unary NOT-operators. “AND NOT” and “OR NOT” are considered single operators. “NOT” is not an operator on its own.
The following is valid
syntax:
Field1 = Value1 AND NOT Field2 = Value2
The following is illegal syntax, and will throw an
error:
Field1 = Value1 AND (NOT Field2 = Value2)