NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-12
Examples—Date-Time Literals
DATETIME "dt" [ start-field TO ] end-field
specifies a constant of data type DATETIME. The start-field to end-field
clause specifies the range and precision of DATETIME fields included in the
constant dt.
Examples—Date-Time Literals
The following are DATETIME literals in default, USA, and European format,
respectively:
DATETIME "1990-01-22:13:40:05.55" YEAR TO FRACTION (2)
DATETIME "01/22/1990 01:40:05.55 PM" YEAR TO FRACTION (2)
DATETIME "22.01.1990 13.40.05.55" YEAR TO FRACTION (2)
The following are DATE literals in default, USA, and European format,
respectively:
DATE "1990-01-22"
DATE "01/22/1990"
DATE "22.01.1990"
date is:
{ yyyy-mm-dd }
{ mm/dd/yyyy }
{ dd.mm.yyyy }
time is:
{ hh:mm:ss }
{ hh:mm:ss [ am | pm ] }
{ hh.mm.ss }
timestamp is:
{ yyyy-mm-dd:hh:mm:ss.msssss }
{ mm/dd/yyyy:hh:mm:ss.msssss [ am | pm ] }
{ dd.mm.yyyy:hh.mm.ss.msssss }
DATEdate specifies a constant of data type DATE
TIME “time specifies a constant of data type TIME
TIMESTAMP “ts specifies a constant of data type TIMESTAMP