IBM SC41-5210-04 Server User Manual


 
Select Records
Type comparisons, press Enter. Specify OR to start each new group.
Tests: EQ, NE, LE, GE, LT, GT, RANGE, LIST, LIKE, IS, ISNOT...
AND/OR Field Test Value (Field, Number, or ’Characters’)
LASTNAME EQ ’Kingsbury’
OR CRLIMIT GE 5000
____ ______________ _____ ______________________________
____ ______________ _____ ______________________________
You can use AND and OR connections together to be even more specific about which records to include
in your report. The following example selects records for customers who placed orders from November
1986, through January 1987. Note that numeric constants are used for months.
Select Records
Type comparisons, press Enter. Specify OR to start each new group.
Tests: EQ, NE, LE, GE, LT, GT, RANGE, LIST, LIKE, IS, ISNOT...
AND/OR Field Test Value (Field, Number, or ’Characters’)
MONTH LIST 11 12
AND YEAR EQ 86
OR MONTH EQ 1
AND YEAR EQ 87
If written out, the above example looks like this:
(MONTH LIST 11,12 AND YEAR EQ 86) OR
(MONTH EQ 1 AND YEAR EQ 87)
Because using a combination of AND and OR connections can be confusing, you might want to use F5 to
look at your report and make sure your comparisons work the way you expect.
If a combination of AND and OR connections seems particularly complex, you should probably look at the
comparisons closely to see if you can use fewer connections to make the same record selection. For
example, following are two ways of selecting records for customers from Rhode Island (‘RI’) who have a
balance due from $900 to $1000 during 1986 OR 1987.
The first method uses a combination of AND and OR connections.
Select Records
Type comparisons, press Enter. Specify OR to start each new group.
Tests: EQ, NE, LE, GE, LT, GT, RANGE, LIST, LIKE, IS, ISNOT...
AND/OR Field Test Value (Field, Number, or ’Characters’)
BALDUE RANGE 900 1000
AND STATE EQ ’RI’
AND YEAR EQ 86
OR BALDUE RANGE 900 1000
AND STATE EQ ’RI’
AND YEAR EQ 87
____ ______________ _____ ______________________________
Written out, this example would look like this:
(BALDUE RANGE 900,1000, AND STATE EQ ’RI’ AND YEAR EQ 86)
OR
(BALDUE RANGE 900,1000 AND STATE EQ ’RI’ AND YEAR EQ 87)
The second method, which uses the LIST test and AND connections, selects the same records but needs
fewer lines and is easier to read:
102 Query for iSeries Use V5R2