Date conversion
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 102
- Joined: Tue Jan 31, 2006 4:13 am
Date conversion
My input column 'AC_COMPLETED' is in the date format of '20060801'. How to convert this string into the date format of '01/08/2008'
Sujatha K
-
- Premium Member
- Posts: 232
- Joined: Fri Aug 04, 2006 1:20 am
- Location: Bangalore
Going that route, you'd need both IConv and OConv. First convert the data to internal format and then back to external format using the desired mask.
If your date is consistent, meaning always 8 digits, you can also go the substring route:
If your date is consistent, meaning always 8 digits, you can also go the substring route:
Code: Select all
Link.AC_COMPLETED[7,2] : '/' : Link.AC_COMPLETED[5,2] : '/' : Link.AC_COMPLETED[1,4]
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 102
- Joined: Tue Jan 31, 2006 4:13 am
Ray,
Incoming date is in the format of 20081001 and business wants to see in the format of '01/10/2008'.
Chulett,
I did as per your suggestion as the incoming date is always having 8 digits. It is working fine. Thank you so much.
DEFAULT.AC_COMPLETED[7,2]:'/':DEFAULT.AC_COMPLETED[5,2]:'/':DEFAULT.AC_COMPLETED[1,4]
Incoming date is in the format of 20081001 and business wants to see in the format of '01/10/2008'.
Chulett,
I did as per your suggestion as the incoming date is always having 8 digits. It is working fine. Thank you so much.
DEFAULT.AC_COMPLETED[7,2]:'/':DEFAULT.AC_COMPLETED[5,2]:'/':DEFAULT.AC_COMPLETED[1,4]
Sujatha K
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Date conversion
This was the cause of my question, of course.sujaoschin wrote:My input column 'AC_COMPLETED' is in the date format of '20060801'.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.