Special Date/Time Values

Moderator: NorbertKrupa

Post Reply
User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Special Date/Time Values

Post by JimKnicely » Thu Apr 12, 2012 5:58 pm

Hi,

Vertica has provided several built in time stamp key words for our convenience:

Examples:

Code: Select all

dbadmin=> select timestamp 'today' midnight_today,
dbadmin->        timestamp 'yesterday' midnight_yesterday,
dbadmin->        timestamp 'tomorrow' midnight_tomorrow,
dbadmin->        time 'allballs' midnight_utc_time;
   midnight_today    | midnight_yesterday  |  midnight_tomorrow  | midnight_utc_time
---------------------+---------------------+---------------------+-------------------
 2012-04-11 00:00:00 | 2012-04-10 00:00:00 | 2012-04-12 00:00:00 | 00:00:00
(1 row)
My favorite is ALLBALLS which is named so because the time digits look like balls (I had to Google that).

Thanks
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

User avatar
Josh
Intermediate
Intermediate
Posts: 106
Joined: Thu Jan 26, 2012 9:38 pm

Re: Special Date/Time Values (FYI)

Post by Josh » Fri Apr 13, 2012 3:10 pm

Hmm, my wife calls me NOBALLS all the time. What does that mean!?!?
Thank you!
Joshua

Post Reply

Return to “Vertica Tips, Lessons and Examples”