how to add OR conditions to where clause?
Posted: Thu 16 Sep 2010 11:54
AddWhere works perfectly for adding AND conditions.
how to simply add any condition?
let's say I have
let's say I want to add "or age > 30"
how can I do without explcitly doing:
???
The above approach forces me to keep manually track at which line the WHERE clause ends, I mean in practice what I do is
how to simply add any condition?
let's say I have
Code: Select all
select * from table
where id > 5
how can I do without explcitly doing:
Code: Select all
msquery1.sql[1] := msquery1.sql[1] + ' or age > 30'
The above approach forces me to keep manually track at which line the WHERE clause ends, I mean in practice what I do is
Code: Select all
const
POS_WHERE: integer := 34 // hardcoded, need to manually check every time I change SQL code
msquery1.sql[POS_WHERE] := msquery1.sql[POS_WHERE] + ' or age > 30'