Hi all,
I am using Oconv function to convert @DATE to YYYY/MM/DD format.
As @DATE output is 15894 which is today's date "07/07/2011".
But when i apply Oconv(@DAY,"D/YMD[4,2,2]") its gives output as "1968/01/07".
Please suggest how these Iconv and Oconv functions works and how i got the above error
Thanks
Kamal
Iconv & Oconv logic
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 17
- Joined: Thu Oct 26, 2006 12:47 am
- Location: chennai
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
@DAY is the day of the month. It only has values between 1 and 31. So applying that Oconv() function to it could only yield values in the range "1968-01-01" through "1968-01-31". Clearly you executed it on the seventh of the month.
To put it another way, @DAY and @DATE are not the same thing.
To put it another way, @DAY and @DATE are not the same thing.
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.
-
- Participant
- Posts: 17
- Joined: Thu Oct 26, 2006 12:47 am
- Location: chennai
-
- Participant
- Posts: 34
- Joined: Mon May 05, 2008 1:31 am
Hi Kamal,
The below code is working fine, it gives the correct output "2011/07/13" .
The below code is working fine, it gives the correct output "2011/07/13"
Code: Select all
Oconv(@DATE,"D/YMD[4,2,2]")