Hi,
I am new to DataStage. I am looking for an available function to change the date format from YYYY-MM-DD to YY-MM-DD. Actually my source flat file has the YYYY-MM-DD format but my target teradata table has a column that has Date datatype and is defined to take YY-MM-DD date format.
Thanks
How to change Date format change from YYYY-MM-DD to YY-MM-DD
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
-
- Participant
- Posts: 133
- Joined: Wed Mar 05, 2003 4:19 pm
- Location: Lima - Peru. Sudamerica
- Contact:
Re: How to change Date format change from YYYY-MM-DD to YY-M
Hi, the other way is use substrings
Your format --> 'YYYY-MM-DD'
Value = DateField[2,8]
Example:
'1999-04-02' applying DateField[2,8]
Value='99-04-02'
Saludos.
![Laughing :lol:](./images/smilies/icon_lol.gif)
Your format --> 'YYYY-MM-DD'
Value = DateField[2,8]
Example:
'1999-04-02' applying DateField[2,8]
Value='99-04-02'
Saludos.
![Laughing :lol:](./images/smilies/icon_lol.gif)
Saludos,
Miguel Seclén
Lima - Peru
Miguel Seclén
Lima - Peru
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Or you can even use the "rightmost substring" to return the rightmost eight characters (remember that there are no data types within DataStage). There are two syntaxes:
Code: Select all
DateField[8]
Right(DateField,8)
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.