DAY
DAYS
MONTH
YEAR
v
A
time expression
performs an operation on a time. Time expressions can contain the following
operators or functions:
+ (Addition)
− (Subtraction)
CHAR
TIME
HOUR
MINUTE
SECOND
MICROSECOND
v
A
timestamp expression
performs an operation on a timestamp. Timestamp expressions can contain
the following operators or functions:
+ (Addition)
− (Subtraction)
CHAR
TIMESTAMP
If any argument can be null, the result field can be null. If any argument is null, the result is null.
Query for iSeries numeric expressions
To define a numeric result field (that is, a result field that contains numbers) for your query, you need to
follow the rules for creating numeric expressions. A numeric expression for a result field can contain the
following, alone or in combination:
v
Numeric field names
(names of fields that contain numbers). You can use the names of numeric fields
listed on the lower part of the display (numeric fields have numbers shown in the
Len
and
Dec
columns)
and the names of previously defined numeric result fields. For example, you can multiply two numeric
fields and put the total in a result field named
AMOUNT
:
AMOUNT = QUANTITY * PRICE
v
Numeric constants
(any numbers such as
4
or
−12.5
). The rules for using numeric constants are:
– The total length can be no more than 31 digits. (For a single-precision floating-point constant, the
total length can be no more than nine digits. For a double-precision floating-point constant, the total
length can be no more than 17 digits.) This includes the digits both to the left and right of the
decimal point but does not include the decimal point. All the digits can be to the right of the decimal
point.
– Use the correct decimal separator. Press F17 to show the decimal separator that must be used (see
“Displaying the format of constants in Query for iSeries” on page 17).
– Do not use a currency symbol (like
$5000
), and do not use thousands separators (like
5,000
).
v
Numeric functions
. The VALUE function returns the first value that is not null. See “VALUE Query for
iSeries function” on page 62.
Other examples of numeric expressions for a field named
AMOUNT
are:
QUANTITY
5
5 + 6
5 + QUANTITY
Chapter 5. Defining result fields in Query for iSeries
59
Содержание @server iSeries
Страница 1: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Страница 2: ......
Страница 3: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Страница 12: ...x Query for iSeries Use V5R2 ...
Страница 14: ...2 Query for iSeries Use V5R2 ...
Страница 18: ...Figure 3 Major Tasks on the Query Menu and the Work with Queries Display 6 Query for iSeries Use V5R2 ...
Страница 32: ...20 Query for iSeries Use V5R2 ...
Страница 38: ...26 Query for iSeries Use V5R2 ...
Страница 44: ...32 Query for iSeries Use V5R2 ...
Страница 116: ...104 Query for iSeries Use V5R2 ...
Страница 122: ...110 Query for iSeries Use V5R2 ...
Страница 146: ...134 Query for iSeries Use V5R2 ...
Страница 150: ...138 Query for iSeries Use V5R2 ...
Страница 174: ...162 Query for iSeries Use V5R2 ...
Страница 178: ...166 Query for iSeries Use V5R2 ...
Страница 196: ...184 Query for iSeries Use V5R2 ...
Страница 198: ...186 Query for iSeries Use V5R2 ...
Страница 204: ...192 Query for iSeries Use V5R2 ...
Страница 205: ...Part 4 Appendixes Copyright IBM Corp 2000 2002 193 ...
Страница 206: ...194 Query for iSeries Use V5R2 ...
Страница 210: ...198 Query for iSeries Use V5R2 ...
Страница 242: ...230 Query for iSeries Use V5R2 ...
Страница 256: ...244 Query for iSeries Use V5R2 ...
Страница 270: ...258 Query for iSeries Use V5R2 ...
Страница 272: ...260 Query for iSeries Use V5R2 ...
Страница 292: ...280 Query for iSeries Use V5R2 ...
Страница 293: ......
Страница 294: ... Printed in U S A SC41 5210 04 ...