× 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.



Hi Sheri,

I think a simple change to the Where clause can eliminate a great deal of 
confusion.  Not operators are great, but the mind has a hard time dealing with 
this in complicated expressions.  I think I's write this as 

WHERE A.PZQTOR > 0 or A.PZQTSH > 0

This clearly states that at least one of these columns must have a value 
greater than zero.  Rows with zero in both fields will not be selected.

hth,
Eric


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Rowe, Sheri
Sent: Monday, January 29, 2007 1:38 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Another SQL question


Hi All,

I would like to know the SQL syntax to exclude records in a file where 2
fields both equal zero.  In the file below I would want all records
except item 33333.

FILEA
ITEM        QTYORDER          QTYSHIP
11111        0                 100
22222        10                 0
33333        0                  0
44444        100               100    

SELECT A.PZCONO, A.PZCSNO, A.PZWHID, A.PZQTOR, A.PZQTSH FROM          
APLUS2FXX/ZPOFILLD A WHERE (NOT(A.PZQTOR = 0) and NOT(A.PZQTSH = 0)) 

When I run this code I only get item 444444.

Thanks in advance.

Sheri R.
Timex Canada



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.