Records are selected if the data in the field
BALDUE
is less than or equal to the data in the field
CRLIMIT
.
When you test for RANGE, the contents of the field must be within the range of two values (greater than
or equal to the first value but less than or equal to the second) for the record to be selected. On the Select
Records display, you must specify two values in the
Value
column, and you must separate them by a
blank. If the first value is greater than the second value for a record, that record will not be selected.
For example, you want to select records only for the months of February through August. The field named
MONTH
is a numeric field, and it contains a
1
to represent January, a
2
to represent February, a
3
to
represent March, and so on. On the Select Records display, you would specify:
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_________
RANGE 2 8___________________________
____
______________
_____ ______________________________
____
______________
_____ ______________________________
To use the GT, GE, LT, LE, and RANGE tests for SBCS character fields and values, you may need to
know the collating sequence. The collating sequence determines what characters are greater than or less
than others. If you do not select a different one, the hexadecimal collating sequence is used and:
v
Most special characters are less than letters.
v
Lowercase letters are less than uppercase.
v
Letters are less than numbers.
For example, the characters A, 8, &, and b would sort from low to high as follows:
&
b
A
8
For more information about selecting or defining a collating sequence, see Chapter 9, “Selecting a collating
sequence in Query for iSeries”.
Testing for values in a list (LIST NLIST) in Query for iSeries
Use the LIST, NLIST tests to determine if the content of a field is equal or not to one of the values that
you list in the
Value
column on the Select Records display.
Note:
See “CCSID and record selection tests in Query for iSeries” on page 253 for information on
CCSIDs and how they affect the Select Records display.
When you compare a field with a list, the record is selected if the contents of the field exactly match one
of the values you specify. The values you specify in the list:
v
Must be numeric constants if you are comparing a numeric field with them.
v
Must be SBCS character constants if you are comparing an SBCS character field with them.
v
Must be SBCS, DBCS-only, or DBCS-open character constants if you are comparing a bracketed-DBCS
field with them. (If the field being tested is a DBCS-only field, the constant can only be a DBCS-only
constant.)
v
Must be DBCS-graphic character constants if you are comparing a DBCS-graphic character field with
them.
v
Must be separated by blanks.
v
Cannot be field names.
Chapter 7. Selecting records in Query for iSeries
97
Summary of Contents for ISERIES SC41-5210-04
Page 1: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 2: ......
Page 3: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 12: ...x Query for iSeries Use V5R2 ...
Page 14: ...2 Query for iSeries Use V5R2 ...
Page 32: ...20 Query for iSeries Use V5R2 ...
Page 38: ...26 Query for iSeries Use V5R2 ...
Page 44: ...32 Query for iSeries Use V5R2 ...
Page 116: ...104 Query for iSeries Use V5R2 ...
Page 122: ...110 Query for iSeries Use V5R2 ...
Page 146: ...134 Query for iSeries Use V5R2 ...
Page 150: ...138 Query for iSeries Use V5R2 ...
Page 174: ...162 Query for iSeries Use V5R2 ...
Page 178: ...166 Query for iSeries Use V5R2 ...
Page 196: ...184 Query for iSeries Use V5R2 ...
Page 198: ...186 Query for iSeries Use V5R2 ...
Page 204: ...192 Query for iSeries Use V5R2 ...
Page 205: ...Part 4 Appendixes Copyright IBM Corp 2000 2002 193 ...
Page 206: ...194 Query for iSeries Use V5R2 ...
Page 210: ...198 Query for iSeries Use V5R2 ...
Page 242: ...230 Query for iSeries Use V5R2 ...
Page 256: ...244 Query for iSeries Use V5R2 ...
Page 270: ...258 Query for iSeries Use V5R2 ...
Page 272: ...260 Query for iSeries Use V5R2 ...
Page 292: ...280 Query for iSeries Use V5R2 ...
Page 293: ......
Page 294: ... Printed in U S A SC41 5210 04 ...