Hi Experts,
I need help in converting the below query into Vertica.
The below is the output I get when the query is run in Oracle.
SELECT TO_CHAR(TO_DATE('0730', 'hh24mi'),'HH24:MI') AS TIME1 FROM DUAL
--07:30
I wanted to get the same result in Vertica. Could you please help me on this?
Regards,
Sreekanth
TO_DATE('0730', 'hh24mi') in Vertica
Moderator: NorbertKrupa
-
- Newbie
- Posts: 3
- Joined: Tue Nov 24, 2015 2:57 pm
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: TO_DATE('0730', 'hh24mi') in Vertica
Use TO_TIMESTAMP instead of TO_DATE:
Code: Select all
dbadmin=> SELECT TO_CHAR(TO_TIMESTAMP('0730', 'HH24MI'), 'HH24:MI') TIME1;
TIME1
-------
07:30
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
-
- Newbie
- Posts: 3
- Joined: Tue Nov 24, 2015 2:57 pm
Re: TO_DATE('0730', 'hh24mi') in Vertica
Thank you very much..it really worked well