Subject | SQLWhereItems |
---|---|
Author | Alan McDonald |
Post date | 2006-10-09T10:21:09Z |
With regard to SQLWhereItems, The help file says:
"Each unit of entries must aggregate to a syntactically valid SQL expression
that evaluates to a Boolean True or False. It is possible to include
parentheses to to provide for nesting of items. By default, all items are
"ANDed" together, but if the OR operator is placed as an item on its own, it
will be used instead of the default 'AND'."
But if I do this
IB_QJobsAccounts.SQLWhereItems.Add('(PROCESSED=''N'')');
IB_QJobsAccounts.SQLWhereItems.Add('OR');
IB_QJobsAccounts.SQLWhereItems.Add('(ABORTED=''Y'')');
The SQL Monitor reveals this translation:
WHERE (
(
(PROCESSED='N')
)
AND OR
)
AND (ABORTED='Y')
and of course there is a syntax error here at "AND OR"
Does anyone know what the trick is to make items get parsed the way I think
the help file intends?
regards
Alan McDonald
"Each unit of entries must aggregate to a syntactically valid SQL expression
that evaluates to a Boolean True or False. It is possible to include
parentheses to to provide for nesting of items. By default, all items are
"ANDed" together, but if the OR operator is placed as an item on its own, it
will be used instead of the default 'AND'."
But if I do this
IB_QJobsAccounts.SQLWhereItems.Add('(PROCESSED=''N'')');
IB_QJobsAccounts.SQLWhereItems.Add('OR');
IB_QJobsAccounts.SQLWhereItems.Add('(ABORTED=''Y'')');
The SQL Monitor reveals this translation:
WHERE (
(
(PROCESSED='N')
)
AND OR
)
AND (ABORTED='Y')
and of course there is a syntax error here at "AND OR"
Does anyone know what the trick is to make items get parsed the way I think
the help file intends?
regards
Alan McDonald