Subject Re: [IBO] SQLWhereItems
Author Helen Borrie
At 08:21 PM 9/10/2006, you wrote:
>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?

I seem to remember it gets out of whack when you've got unnecessary
brackets in there, i.e. it's assuming nesting because of the
redundant brackets.

In a rush, no time to test it out, sorry.

Helen