The Vertica Forum recently got a makeover! Let us know what you think by filling out this short, anonymous survey.
Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!
Date format
Hi,
Is it possible to get date in "201703" format from Vertica where 2017 is year and 03 is the months??
0
Comments
I assume you want to extract the year and month from a given date and output it in the format YYYYMM? If so, this is what I came up with:
Here are a few variations on the same theme:
I suggest something slightly simpler... the to_char function.
CBear=> select to_char('2017-03-22'::date, 'YYYYMM');
to_char
201703
(1 row)
much simpler!