SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
D-13
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
These examples are DATETIME literals in default, USA, and European format,
respectively:
DATETIME "2004-01-22:13:40:05.55" YEAR TO FRACTION (2)
DATETIME "01/22/2004 01:40:05.55 PM" YEAR TO FRACTION (2)
DATETIME "22.01.2004 13.40.05.55" YEAR TO FRACTION (2)
These examples are DATE literals in default, USA, and European format,
respectively:
DATE "2004-01-22"
DATE "01/22/2004"
DATE "22.01.2004"
These examples are TIME literals in default, USA, and European format,
respectively:
TIME "13:40:05"
TIME "1:40:05 PM"
TIME "13.40.05"
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 }
DATE “date” 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