Month query for iseries function, Second query for iseries function – IBM ISERIES SC41-5210-04 User Manual

Page 90

Advertising
background image

MONTH Query for iSeries function

The MONTH function returns the month part of a value. The form is:

MONTH ( expression )

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 duration or a timestamp duration, the result is the month part of the value, which
is a binary field with a value between &minus 99 and 99. A nonzero result has the same sign as the
argument.

Example:

MONTH(TIMESTAMP) where TIMESTAMP = 1991-10-22-12.15.23.123456

The resulting value of MONTH equals 10.

SECOND Query for iSeries function

The SECOND function returns the seconds part of a value. The form is:

SECOND ( expression )

The argument must be either a:
v Time
v Timestamp
v Time 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 time or timestamp, the result is the seconds part of the value, which is a binary field
with a value between 0 and 59.

If the argument is a time duration or a timestamp duration, the result is the seconds part of the value,
which is a binary field with a value between −99 and 99. A nonzero result has the same sign as the
argument.

Example:

SECOND(TIMESTAMP) where TIMESTAMP = 1991-10-22-12.15.23.123456

The resulting value of SECOND equals 23.

78

Query for iSeries Use V5R2

Advertising