cancel
Showing results for 
Search instead for 
Did you mean: 

add_year function in hana sql

former_member185537
Participant
0 Kudos

Hello Experts,

I have tried to use a ADD_YEAR in the sql hana and the return value is in this format "December 12, 2015 12:00:00 AM". I just require the date in dd.mm.yyyy as return. code is given below. Is there any function for this ?

SELECT
	 ADD_YEARS( ERDAT,
	 5 ) ,
	 ERDAT 
FROM "SAPABAP1"."VBAK"
;

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

One option is to use the TO_NVARCHAR function using the format option.

SELECT TO_NVARCHAR( ADD_YEARS( ERDAT, 5 ), 'DD.MM.YYYY' ),
       ERDAT 
FROM "SAPABAP1"."VBAK";

Answers (0)