on 02-24-2015 2:10 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chaitanya
Did Solutions above worked for you if not let us know so that we can help better
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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()...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.