Hi,
I reading from Oracle database and loading into sequecial file.
From Oracle source Date is coming as
21-03-11
15-04-00
16-11-81
and we need output as
21-03-2011
15-04-2000
16-11-1981
I am trying to function StringtoDate(Columnname,"%dd-%mm-%yyyy").
But its not getting converted in required format.
Please suggest if I am using wrong derivation.
Thanks.
Date datatype conversion
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 43
- Joined: Mon Mar 03, 2008 10:58 pm
- Location: Chennai
Re: Date datatype conversion
Hi,
StringtoDate(Columnname,"%dd-%mm-%yyyy").
Here ,"%dd-%mm-%yyyy" should match with your source data. Just try that.
Thanks
StringtoDate(Columnname,"%dd-%mm-%yyyy").
Here ,"%dd-%mm-%yyyy" should match with your source data. Just try that.
Thanks
Re: Date datatype conversion
Hi,
Thanks for reply.
This means if my source data is like 21-03-11 then it should be
StringtoDate(Columnname,"%dd-%mm-%yy") and output will be as
21-03-2011.
Thanks,
Santosh
Thanks for reply.
This means if my source data is like 21-03-11 then it should be
StringtoDate(Columnname,"%dd-%mm-%yy") and output will be as
21-03-2011.
Thanks,
Santosh
Hi,
Just try
if the result is still not as exepected, then apply one more DateToString()
Just try
Code: Select all
StringToDate(column,"%(d,s)-%(m,s)-%yy).
pandeeswaran
Re: Date datatype conversion
No, your output will be a date which has no external format. If you need another string then you'll need to enclose the result in a DateToString() function with the appropriate output mask.srai wrote:This means if my source data is like 21-03-11 then it should be StringtoDate(Columnname,"%dd-%mm-%yy") and output will be as 21-03-2011.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers