Hi Iam trying to convert String to Date using Modify Stage.
And the function which iam using is
Date:Date=date_from_string[%mmm %dd, %yyyy](Date)
My input format is of string and is like June 14, 2010
when I run this it gives a warning saying
Data string 'June 14, 201' does not match format '%mmm %dd, %yyyy': an integer was expected to match tag %dd.
What is this warning, how to resolve this please help!!
-thanks, Raj.
DateFromString Function
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 19
- Joined: Fri May 14, 2010 3:54 pm
DateFromString Function
Rajesekhar Potteti
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
"%mmm" matches the three-character abbreviation of the month name.
You need to research the correct formulation in the date format picture. From memory - because I can't check at the moment, the full month name is pictured by "%mmmm".
You need to research the correct formulation in the date format picture. From memory - because I can't check at the moment, the full month name is pictured by "%mmmm".
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.
date Function by Using Modify stage
Hi Rajeseaker,
You mention as Date:Date= What is the first Date mean is it the column name , if yes please change the Column name because The Date is datatype so it not accept as column name, the correct syntax is
Source _ColumnName:datatype =date_from_string(Destination column name["%mmm %dd, %yyyy"]
Let me know if it work
You mention as Date:Date= What is the first Date mean is it the column name , if yes please change the Column name because The Date is datatype so it not accept as column name, the correct syntax is
Source _ColumnName:datatype =date_from_string(Destination column name["%mmm %dd, %yyyy"]
Let me know if it work
Ramesh Kumar.M
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am
-
- Premium Member
- Posts: 138
- Joined: Wed Jul 16, 2008 9:51 pm
- Location: Kolkata
As pointed by Ray, for full month name %mmmm should be specified.
"%mmm" will give January as Jan, September as Sep etc,.
So the code for your requirement is
"%mmm" will give January as Jan, September as Sep etc,.
So the code for your requirement is
Code: Select all
Source _ColumnName:datatype =date_from_string(Destination column name["%mmmm%dd, %yyyy"]
TONY
ETL Manager
Infotrellis India
"Do what you can, with what you have, from where you are and to the best of your abilities."
ETL Manager
Infotrellis India
"Do what you can, with what you have, from where you are and to the best of your abilities."