×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 3/9/11 9:04 AM, Ruthirapathi, Arulanandham X wrote:
I would like to create condition with logical operator OR in WRKQRY,
could you give me an example please?
Probably better to just use SQL instead, with all the free-form and
parenthetical conditional logic of the WHERE clause versus the listed
conditions in "OR groups" of the QRY feature; e.g. use STRQMQRY for a
report from a SELECT statement. Or possibly using the SQL only to
encapsulate the WHERE logic of the SELECT statement in a VIEW, if a
*QRYDFN must be used for some reason.
Each OR conditional test in the "Record Selection" screen of
Query/400 effects an implicit closed parenthesis for all prior
conditions in the list and starts an implicit open parenthesis for the
remaining conditions in the list.
Given the following list of conditions [although written
here left-to-right versus top-to-bottom] are in a Query:
Cond_A AND Cond_B OR Cond_C
that list of conditions effects the logical equivalent of:
( Cond_A AND Cond_B ) OR ( Cond_C )
However, in many cases the desired effect is instead:
Cond_A AND ( Cond_B OR Cond_C )
but per inability to specify precedence with parentheses,
the listed conditions must be written in the Query as:
Cond_A AND Cond_B OR Cond_A AND Cond_C
that list of conditions effects the logical equivalent of:
( Cond_A AND Cond_B ) OR ( Cond_A AND Cond_C )
Regards, Chuck
As an Amazon Associate we earn from qualifying purchases.