Vertica Date Function Support

TDV supports the date functions listed in the table below for Vertica.

With Vertica date functions, push results may differ from no-push results. For example:

Although Vertica accepts TIMESTAMP as an argument for MONTHS_BETWEEN, it ignores the time part while calculating. TDV honors the time part while calculating.
DATEDIFF calculates results according to ticks (boundaries) crossed within a date or time range (counting the enddate but not the startdate). For years, the boundary is January 1. Months are based on calendar months, not the days within months. Weeks start at midnight on Sunday. Days are based on calendar days, not the hours within days, and so on.

Vertica Date Function

Notes

ADD_MONTHS

 

AT TIME ZONE

 

CLOCK_TIMESTAMP

 

CURRENT_DATE

 

CURRENT_TIME

 

CURRENT_TIMESTAMP

 

DATEDIFF

 

DATE_PART

 

DATE_TRUNC

 

DAY

 

DAYOFMONTH

 

DAYOFWEEK

 

DAYOFWEEK_ISO

 

DAYOFYEAR

 

DAYS

 

EXTRACT

.

GETDATE

Not supported. Use SYSDATE (identical).

GETUTCDATE

 

HOUR

 

ISFINITE

 

JULIAN_DAY

 

LAST_DAY

 

LOCALTIME

 

LOCALTIMESTAMP

 

MICROSECOND

 

MIDNIGHT_SECONDS

 

MINUTE

 

MONTH

 

MONTHS_BETWEEN

Because

NEW_TIME

Vertica 6.1 only.

NEXT_DAY

 

NOW

 

QUARTER

 

ROUND

For date/time arguments.

SECOND

 

STATEMENT_TIMESTAMP

 

SYSDATE

 

TIMEOFDAY

 

TIMESTAMPADD

Keywords that TDV requires in the TDV source code as the first argument (no quotation marks):

SQL_TSI_FRAC_SECOND
SQL_TSI_SECOND
SQL_TSI_MINUTE
SQL_TSI_HOUR
SQL_TSI_DAY
SQL_TSI_WEEK
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_YEAR

TIMESTAMP_ROUND

 

TIMESTAMP_TRUNC

 

TIMESTAMPDIFF

Keywords that TDV requires in the TDV source code as the first argument (no quotation marks):

SQL_TSI_FRAC_SECOND
SQL_TSI_SECOND
SQL_TSI_MINUTE
SQL_TSI_HOUR
SQL_TSI_DAY
SQL_TSI_WEEK
SQL_TSI_MONTH
SQL_TSI_QUARTER
SQL_TSI_YEAR

TRUNC

 

WEEK

 

WEEK_ISO

 

YEAR

 

YEAR_ISO