cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple date conversions in one field.

Former Member
0 Kudos

Hello SAPians..

I have source date column having the data in the form of DD-MM-YYYY, YYYY.MM.DD and  MM/YYYY/DD format.

What I want to do is I want to integrate them into one format.

So please guide me first how to differentiate which records have following

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vaishaali,

You can use the string functions to find -,.,/ based on which you can differentiate them using a case transform and them use to_date or to_char to convert into system format or your given format.

Regards,

Sandeep

Answers (1)

Answers (1)

Former Member
0 Kudos

Can you please provide me the code logic by taking one sample scenario.

--Thanks in advance.

Former Member
0 Kudos

Add a new column map it to decode(index(date,'.',1) is not null,'DOT',index(date,'-',1) is not null,'DASH','SLASH'). Here date is column which contains the possible dates. The Output result will look as below. Then place a case tranform to seperate it.

DateSeperator
YYYY.MM.DDDOT
DD-MM-YYYYDASH
MM/YYYY/DDSLASH