BetweenExpression

The BetweenExpression is part of the Dynamic Where feature; it represents the BETWEEN SQL operator.

Implementations

Example

Target SQL where clause:

WHERE PRICE BETWEEN 20 AND 50

WhereExpression where = new BetweenExpression(
              new FieldExpression("OrderDetails","price"),
              new ConstantExpression(20),
              new ConstantExpression(50));

let whereExpression: WhereExpression = RemObjects.DataAbstract.Expressions.BetweenExpression(
                    FieldExpression("OrderDetails","Price"),
                    ConstantExpression(20),
                    ConstantExpression(50))

WhereExpression where = new BetweenExpression(
              new FieldExpression("OrderDetails","price"),
              new ConstantExpression(20),
              new ConstantExpression(50));

let whereExpression: WhereExpression = BetweenExpression(
                    FieldExpression("OrderDetails","Price"),
                    ConstantExpression(20),
                    ConstantExpression(50))

with ClientDataModule.tbl_OrderDetails, DynamicWhere do begin
  Expression:=NewBetweenExpression(
                NewField(LogicalName, 'price'),
                NewConstant(20),
                NewConstant(50));
end;

Generated XML

<?xml version="1.0"?>
<query xmlns="http://www.remobjects.com/schemas/dataabstract/queries/5.0" version="5.0">
  <where>
    <between>
      <field tablename="OrderDetails">price</field>
      <constant type="Byte" null="0">20</constant>
      <constant type="Byte" null="0">50</constant>
    </between>
  </where>
</query>