Hi, can you help me? I have oracle dataset and perform QBE.

This values are entered into fields:

CRCO: in ('*', 'B')
LM_LSTART: not 'LK*' and 'EP*'

Generated QBE:
Code
SELECT *
  FROM l_lety_main
 WHERE NOT (UPPER (LM_LSTART) LIKE 'LK%' OR UPPER (LM_LSTART) LIKE 'EP%')
    OR UPPER (LM_LSTART) IS NULL AND (UPPER (LM_CRCO) IN ('*', 'B'))
Problem is OR UPPER (LM_LSTART) IS NULL because, there is not parenthesis.

Correct SQL must be like:
Code
SELECT *
  FROM l_lety_main
 WHERE (   NOT (UPPER (LM_LSTART) LIKE 'LK%' OR UPPER (LM_LSTART) LIKE 'EP%')
        OR UPPER (LM_LSTART) IS NULL
       )
   AND (UPPER (LM_CRCO) IN ('*', 'B'))
Sorry my poor English.

DOA 4.0.6.2
DELPHI 6.0