Hi,
I need to convert a input field which is string to date.Eg(1/12/2006).
I am using the function date_from_string(input column)..I am getting a fatal error.But when i use a proper date like 2006/12/01 the function is working fine.How to solve this problem.
Regards,
Bala.
Modify Stage-Type conversion from string to date
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The format string may need to be "%mm/%dd/%yyyy" (note the use of "/" as the separator character, to match the data) and it may be necessary to guarantee the leading zero on the month and day components.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Read again "and it may be necessary to guarantee the leading zero on the month and day components". Use substring, concatenation and If constructs to get the format right.
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.