DATE Query for iSeries function
The DATE function returns a date from a value. The form is:
QQ DATE (
expression
)
QR
The argument must be either a:
v
Timestamp
v
Date
v
Positive number or expression less than 3 652 059
v
Valid character representation of a date
v
Character representation with a length of 7
If the argument is a character representation of length 7, it must represent a valid date in the form
yyyynnn
where
yyyy
represents the year digits and
nnn
represents digits between 001 and 366, signifying a day in
that year.
The result of this function is a date. If the argument can be null, the result can be null. If the argument is
null, the result is null.
v
If the argument is a timestamp, the result is the date part of the timestamp.
v
If the argument is a date, the result is that date.
v
If the argument is a number, the result is the date that is
n
−1 days after January 1, 0001.
v
If the argument is a character value, the result is the date represented by the character string.
Note:
If the OS/400 two-digit year format is used, the range of dates is 1940 through 2039. Any year from
40 through 99 is assumed to have a century of 19. Any year 00 through 39 is assumed to have a
century of 20. If a value outside of that range is in a field with a two-digit year format, it will be
shown on a report as +’s. Use the CHAR function on that field specifying a SAA date format, and
then select the result field for the report.
Example:
DATE(STRDATE)
DAY Query for iSeries function
The DAY function returns the day part of a value. The form is:
QQ DAY (
expression
)
QR
The argument must be either a:
v
Date
v
Timestamp
v
Date duration
v
Timestamp duration
The result of the function is a binary field. If the argument can be null, the result can be null. If the
argument is null, the result is null.
If the argument is a date or a timestamp, the result is the day part of the value, which is a binary field with
a value between 1 and 31.
Chapter 5. Defining result fields in Query for iSeries
75
Summary of Contents for @server iSeries
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 ...