cancel
Showing results for 
Search instead for 
Did you mean: 

Date to convert to MM/DD/YYYY

Former Member
0 Kudos

Hi,

I have Character Field contains value = 2015.02.23 (sysdate()).

I want output as 02/23/2015.

I coded as to_date(<field>, 'MM/DD/YYYY')

I have got error as 15 can not be converted to month.

Could you please help me what expression I need to use?.

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

kamal264
Active Participant

to_char(to_date(<field>, 'YYYY.MM.DD'), 'MM/DD/YYYY')


1. First you have to convert char into date format and have to mention the source format in second parameter 'YYYY.MM.DD'

2. After conevrting into date use to_char function to convert the same into your desired output format 'MM/DD/YYYY')



Note: if input column is already of date type then use to_char(<field>,'MM/DD/YYYY')


~Kamal


Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Chaitanya

Did Solutions above worked for you if not let us know so that we can help better

baljinder_nagra
Explorer
0 Kudos

Try this...

to_date(<your field>, 'YYYY.MM.DD')

your target field should be a "date" data type, and after this transform you will then be able to process the column like a date field however you need.

See this link for examples on how to use to_date()...

http://scn.sap.com/community/data-services/blog/2013/06/12/convertion-functions-in-bods-with-example...