How would I add the statement
- where left(Field1,3)=‘abc’
- where convert(varchar,Field2,23) = ‘2017-02-06’
in a TDAWhereBuilder?
How would I add the statement
in a TDAWhereBuilder?
you can use something like
with table, table.DynamicWhere do
Expression := NewBinaryExpression(
NewMacro('left', [NewField('','Field1'), NewConstant(3)]),
NewConstant('abc'),
dboEqual);
and
with table, table.DynamicWhere do
Expression := NewBinaryExpression(
NewMacro('convert', [NewMacro('varchar'),
NewField('','Field2'),
NewConstant(23)]),
NewConstant('2017-02-06'),
dboEqual);
Note: left
, convert
and varchar
are unknown macro for DA and they should be handled in OnUnknownMacroVariable
event of DAService.
thank you !!!
Best Regards!