2

How can I get Vertica function to_date('','format') do output like this:

DDMonYYYY - 01/ABR/2012 

and not like it does (01-04-2012)?!

dbadmin=> select now();
              now
--------------------------------
 19/09/2012 11:03:48.284339 BRT
(1 row)

dbadmin=> show datestyle;
   name    | setting
-----------+----------
 datestyle | SQL, DMY
(1 row)
Alex Shesterov
  • 26,085
  • 12
  • 82
  • 103
Up_One
  • 5,213
  • 3
  • 33
  • 65

2 Answers2

6

Try this:

SELECT TO_CHAR(CURRENT_TIMESTAMP, 'DD/MON/YYYY');
deadrunk
  • 13,861
  • 4
  • 29
  • 29
0

to_date() takes a string and converts it into a date object. The output you see returned is not formatted to the specified format. It is just an acknowledgement that the date object got created.

kimbo305
  • 662
  • 3
  • 11