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:

vDate

vTimestamp

vDate duration

vTimestamp 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:

vTime

vTimestamp

vTime duration

vTimestamp 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.

78Query for iSeries Use V5R2

Page 90
Image 90
IBM SC41-5210-04 manual Month Query for iSeries function, Second Query for iSeries function