Issue with Loading Date
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 142
- Joined: Mon Jun 27, 2005 5:31 pm
- Location: Atlanta GA
Issue with Loading Date
I have this situation. Source is a csv file. I am reading everything as varchar and trying to load to Teradata. There is a column which has dates, from the source. In the transfomer I am doing a StringToDate(IP,'yyyy-mm-dd'). Issue is for 01/01/01 it is loading as 1901-01-01 instead of 2001-01-01. Is there any way other than padding the string and then converting to date. Any thoughts are appreciated.
Venkat Velagapudi
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Read up about format strings and about century pivot.
You can, in fact, combine the two. For example, a format string of "2000yy-mm-dd" will force the century part of the year to be "20".
Where you only have two digit years you will definitely need to specify the century pivot year to something other than its default (1930).
You can, in fact, combine the two. For example, a format string of "2000yy-mm-dd" will force the century part of the year to be "20".
Where you only have two digit years you will definitely need to specify the century pivot year to something other than its default (1930).
Last edited by ray.wurlod on Tue Jan 08, 2013 1:34 am, edited 1 time in total.
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.
-
- Premium Member
- Posts: 353
- Joined: Mon Jan 17, 2011 5:03 am
- Location: Mumbai, India
-
- Premium Member
- Posts: 142
- Joined: Mon Jun 27, 2005 5:31 pm
- Location: Atlanta GA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: