Date
Moderators: chulett, rschirm, roy
Date
Hi,
Iam facing issue from 2 days can any one help on this
My input is
3/21/2001 i want to convert into date fomat
i am using the below function
(StringToDate(Right(Str('0',1):Field(lnk_to_trsf_validation.D_TRADE_DATE,"/",1,1),2):'/':Field(lnk_to_trsf_validation.D_TRADE_DATE,"/",2,2),"%mm-%dd-%yyyy"))
when i am running this i am not able to load into the target.
with warnings and error
Warnings: Data string '0/' does not match format '%mm-%dd-%yyyy': the value for tag %mm has fewer characters than expected.
Conversion error calling conversion routine date_from_ustring data may have been lost.
Please help me on this.
Thanks & regards,
Iam facing issue from 2 days can any one help on this
My input is
3/21/2001 i want to convert into date fomat
i am using the below function
(StringToDate(Right(Str('0',1):Field(lnk_to_trsf_validation.D_TRADE_DATE,"/",1,1),2):'/':Field(lnk_to_trsf_validation.D_TRADE_DATE,"/",2,2),"%mm-%dd-%yyyy"))
when i am running this i am not able to load into the target.
with warnings and error
Warnings: Data string '0/' does not match format '%mm-%dd-%yyyy': the value for tag %mm has fewer characters than expected.
Conversion error calling conversion routine date_from_ustring data may have been lost.
Please help me on this.
Thanks & regards,
-
- Participant
- Posts: 15
- Joined: Thu Aug 07, 2008 2:56 am
Re: Date
StringToDate('03/21/2011',"%mm/%dd/%yyyy") . This will do.
Initially please know the format of your D_TRADE_DATE.
Then it will be easy for conversion.
For that use peek to debug the date format.
Initially please know the format of your D_TRADE_DATE.
Then it will be easy for conversion.
For that use peek to debug the date format.
Karthik
Make It Work Make It Right Make It Fast
Make It Work Make It Right Make It Fast
-
- Participant
- Posts: 15
- Joined: Thu Aug 07, 2008 2:56 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
ntr,
You posted this same question a few days ago and were answered with what should have been the correct solution (which uses what Ray suggests in his reply). Did you try the suggested solution? Did it work?
Your earlier thread: http://dsxchange.com/viewtopic.php?t=143247
Regards,
You posted this same question a few days ago and were answered with what should have been the correct solution (which uses what Ray suggests in his reply). Did you try the suggested solution? Did it work?
Your earlier thread: http://dsxchange.com/viewtopic.php?t=143247
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
James - you don't need any special tags or that 'sid' portion, just the simple URL pasted in works all by itself. FYI.
Ray - sorry for the (slight) derail but when did the single character date masks become 'flexible format' masks? I thought (back in the day) that %m matches one-digit months and %mm matches two-digit months and never the twain shall meet. Older posts have shenanigans to check lengths and stick a zero on the front of the 'short' months/days. Now they will happily match one or two digits?
Ray - sorry for the (slight) derail but when did the single character date masks become 'flexible format' masks? I thought (back in the day) that %m matches one-digit months and %mm matches two-digit months and never the twain shall meet. Older posts have shenanigans to check lengths and stick a zero on the front of the 'short' months/days. Now they will happily match one or two digits?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
V for Vendetta....wait, wrong reference
'v' with %ddd (only) to indicate variable-width day of year. "(%ddd,v)"
's' with several of the formats to allow leading spaces. day, month, 2-digit year, and week of year
plus a few scattered ones for formatting day and month strings
'v' with %ddd (only) to indicate variable-width day of year. "(%ddd,v)"
's' with several of the formats to allow leading spaces. day, month, 2-digit year, and week of year
plus a few scattered ones for formatting day and month strings
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.