DATE
Converts the input value to a DATE data type.
Converts the input value to a
DATE data type.
Behavior type
-
Immutable if the input value is a
TIMESTAMP,DATE,VARCHAR, or integer -
Stable if the input value is a
TIMESTAMPTZ
Syntax
DATE ( value )
Parameters
value- The value to convert, one of the following:
-
TIMESTAMP,TIMESTAMPTZ,VARCHAR, or anotherDATE. -
Integer: Vertica treats the integer as the number of days since 01/01/0001 and returns the date.
-
Examples
=> SELECT DATE (1);
DATE
------------
0001-01-01
(1 row)
=> SELECT DATE (734260);
DATE
------------
2011-05-03
(1 row)
=> SELECT DATE('TODAY');
DATE
------------
2016-12-07
(1 row)