convert date function
Moderators: chulett, rschirm, roy
convert date function
Hello,
Can you please in coverting my date fuction.
My input is dataset --- transformer ---- DB2 stage.
Input is varchar field and output is date field
date coming from source is mm/dd/yyyy and i need to convert this to yyyy-mm-dd.
Ay help is much appreciated.
Thanks
Pavan
Can you please in coverting my date fuction.
My input is dataset --- transformer ---- DB2 stage.
Input is varchar field and output is date field
date coming from source is mm/dd/yyyy and i need to convert this to yyyy-mm-dd.
Ay help is much appreciated.
Thanks
Pavan
pavan
Yeah.. i have see those posts..and applied the logic but still geeting the errorpandeesh wrote:Hi, there are a lot of examples recently given for StringToDate conversion.
Please check those posts.
Still if you have any doubts, please let us know.
I haved the function like this StringToDate(Column name,"%mm/%dd/%yyyy")
here is the error
APT_CombinedOperatorController,2: Data string '2/28/2012' does not match format '%mm/%dd/%yyyy': the value for tag %mm has fewer characters than expected.
Please help me how to fix this.....
pavan
-
- Participant
- Posts: 47
- Joined: Thu Oct 04, 2007 3:37 am
- Location: chennai
I am curious what does that 's' in %(m,s) mean?premupdate wrote:Try StringToDate(Column name,"%(m,s)/%dd/%yyyy")
It might work..
In his case, i believe the below will work:
Code: Select all
StringToDate(Column name,"%m/%dd/%yyyy")
Code: Select all
StringToDate(Column name,"%m/%d/%yyyy")
Thanks
pandeeswaran
Hi,premupdate wrote:Try StringToDate(Column name,"%(m,s)/%dd/%yyyy")
It might work..
I used this function StringToDate(Column name,"%(m,s)/%dd/%yyyy") and it worked for me....thanks for that..... i haved read what 's' specifies and it specify this option to allow leading spaces in date formats.
Thanks again.
pavan
-
- Participant
- Posts: 47
- Joined: Thu Oct 04, 2007 3:37 am
- Location: chennai