Displaying constants format in query for iseries – IBM ISERIES SC41-5210-04 User Manual

Page 81

Advertising
background image

Displaying constants format in Query for iSeries

The Display Constants Format display shows you what date or time format you must use if you specify a
date or time constant and do not use an SAA format.

Display Constants Format

Query . . . . . . :

QRY1

Option . . . . . :

CHANGE

Library . . . . :

QGPL

CCSID . . . . . . :

65535

Use an SAA format to enter a date or time constant, or

use the format described by the following values.

Use the decimal separator shown.

Query definition values

Date format . . . . :

*MDY

Date separator . . :

/

Time format . . . . :

*HMS

Time separator . . :

:

Decimal separator . :

.

Press Enter to continue.

F12=CANCEL

The Display Constants Format display appears when you:
v Change a query from the Work with Queries display and at least one date or time constant is specified

in the query definition in an OS/400 format other than the date or time format specified for your job.

v Display a query from the Work with Queries display and your job format for the date or time is different

from an OS/400 date or time format constant that is specified in the query definition.

v Use the run-time record selection option of the RUNQRY command and your job format for the date

or time is different from an OS/400 date or time format constant specified in the query definition.

v Use the run-time record selection option with the QRYRUN procedure and your job format for the date

or time is different from an OS/400 date or time format constant specified in the query definition.

v Press F17 from the Select Records display.
v Press F17 from the Define Result Fields display.

OS/400 date formats are MDY, YMD, DMY, and JUL. The valid OS/400 time format is HHMMSS.

Date, time, and timestamp arithmetic operations in Query for iSeries

Addition and subtraction operations can be performed on date, time, and timestamp values to determine
the result-field value.

Note: If an addition operand is a date, time, or timestamp value, the other operand must be a duration.

The following rules apply to date, time, and timestamp addition:
v If one operand is a date, the other operand must be either a date duration or a labeled duration of

years, months, or days.

v If one operand is a time, the other operand must be either a time duration or a labeled duration of

hours, minutes, or seconds.

v If one operand is a timestamp, the other operand must be a duration. Any duration type is valid.

Chapter 5. Defining result fields in Query for iSeries

69

Advertising