cancel
Showing results for 
Search instead for 
Did you mean: 

Convert to DD/MM/YYYY format - SELECT statement Hana SQL Script

anthony_mendes3
Participant
0 Kudos

Hi Experts,

Just need some assistance with HANA SQL script.(SELECT statement) 

Is there a function to convert current_date to a 'dd/mm/yyyy' format?

thanks

Tony 

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

Even if the format is not listed in the current documentation, you can use a statement like

SELECT TO_NVARCHAR(CURRENT_DATE, 'DD/MM/YYYY') as "MyConvertedCurrentDate" from dummy;

If really a format is not supported you could also use functions DAYOFMONTH, MONTH and YEAR to extract the single components of a date value and concatenate the string by yourself (with some formatting).

Regards,

Florian

anthony_mendes3
Participant
0 Kudos

Thanks Florian.

Answers (1)

Answers (1)

former_member299313
Participant

and how do you change the number to the name of the month in SQL HANA?