Syntax to convert Datetime to Date

Hello All,


I am very new to Veritica and i am stuck at this issue.


I have a column called 'Transactiodatetime' in my Table. I am creating a View on top of this Table but in the View i need a RequestDate column.


Below is the Syntax i am using but i am getting an Error


select to_char(transactiondatetime,'DD-MM-YYYY') as RequestDate


Error - [Error Code: 2005, SQL State: 42601]  [Vertica][VJDBC](2005) ERROR: Multiple decimal points.


Can someone please help me getting the correct syntax.


Thanks in advance !!



  • Options
    edited March 2019

    I also have this error. I'm using vertica 9.0.x. I wonder why experienced Vertica folks are ignoring this post for 3 years now as if the error is supposed to be self-explanatory.

    Anyway, I'd like to share that the issue for me was this: I encountered the error because the column that I thought was a TIMESTAMP data type, the column that I used in the TO_CHAR function, was actually of VARCHAR data type.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file