IBM SC41-5210-04 manual Days Query for iSeries function, Hour Query for iSeries function

Models: SC41-5210-04

1 294
Download 294 pages 6.42 Kb
Page 88
Image 88

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

Example:

RESULT(DAY) = DAY(HIREDATE)

RESULT(DAY) would equal a value between 1 and 31.

DAYS Query for iSeries function

The DAYS function returns a numeric representation of a date. The form is:

DAYS ( expression )

The argument must be either a:

vDate

vTimestamp

vValid character representation of a date

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.

The result is one more than the number of days from January 1, 0001 to D, where D is the date that would occur if the DATE function were applied to the argument.

Example:

RESULT(DAY) = DAYS(CURRDATE) - DAYS(HIREDATE)

RESULT(DAY) equals a number representing the number of days between these two dates.

HOUR Query for iSeries function

The HOUR function returns the hour part of a value. The form is:

HOUR ( 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 a timestamp, the result is the hour part of the value, which is a binary field with a value between 0 and 24.

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

Example:

HOUR(TIME) where time = 12:11:22

76Query for iSeries Use V5R2

Page 88
Image 88
IBM SC41-5210-04 manual Days Query for iSeries function, Hour Query for iSeries function