[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: conditional statement



Virtually every time you use "not equal" in a condition, it should be pared with
"and" between the conditions. Change your code to:

if #Empl_Record = 1 AND ($Status    <> 'A'
                         AND $Status <> 'Q'
                         AND $Status <> 'P'
                         AND $Status <> 'U')
        do Select-Address
else
        do Fetch-Address
end-if





"Cadenas, Maria (MT)" <MCadenas@DOW.COM> on 02/07/2001 10:30:21 AM

Please respond to sqr-users@list.iex.net

To:   SQR-USERS@list.iex.net
cc:    (bcc: Rodney Wright/Trcb/Rouse)

Subject:  conditional statement



I'm having trouble with the following conditional sentence.  I need a
statement that would select only employees with an employee record = 1 and a
status NOT equal to A,Q,P, or U.  It is the OR clause that is giving me
trouble. Any suggestions?

if #Empl_Record = 1 AND ($Status    <> 'A'
                         OR $Status <> 'Q'
                         OR $Status <> 'P'
                         OR $Status <> 'U')
        do Select-Address
else
        do Fetch-Address
end-if