Date Conversion problem
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 44
- Joined: Fri Mar 16, 2007 5:51 am
Date Conversion problem
Hi,
i have requirement like this..........
my source data coming from COBOL DATE format (0823 MMYY) so i want to load the date into Oracle date format like(08/23 MM/YY) ,i have tried Ocon and Iconv but its not working...........
plz do needful................
i have requirement like this..........
my source data coming from COBOL DATE format (0823 MMYY) so i want to load the date into Oracle date format like(08/23 MM/YY) ,i have tried Ocon and Iconv but its not working...........
plz do needful................
seshu
Is "0823" supposed to be "August, 2023" or "August, 1923" or another date? In order to put this into an Oracle DATE you will need to add a day-of-month as well. What should that be, day 1?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Re: Date Conversion problem
Just convert your input 0823 into 08/23 like "MM/YY" ........Then use
OCONV(ICONV("05/08","D2/MY"),"D/E") to give you date in your format....check for oconv for various formats.......using proper format you can insert it into oracle database.
OCONV(ICONV("05/08","D2/MY"),"D/E") -----> 01/05/2008
OCONV(ICONV("05/08","D2/MY"),"D/E") to give you date in your format....check for oconv for various formats.......using proper format you can insert it into oracle database.
OCONV(ICONV("05/08","D2/MY"),"D/E") -----> 01/05/2008
-
- Participant
- Posts: 44
- Joined: Fri Mar 16, 2007 5:51 am
Then you cannot store it in an Oracle DATE as they require a full date. If you literally just want to store 'MMYY' you'd need a CHAR or VARCHAR2 field for that, otherwise you will need to add a 'day' to the date before formatting it for Oracle.
After that, people can choose not to extract the day when selecting the field.
After that, people can choose not to extract the day when selecting the field.
Last edited by chulett on Fri May 16, 2008 6:37 am, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
So one possible answer is to get an internal date by adding day 1 of each month.
Code: Select all
ICONV('01':In.CobDateCol,'D2DMY[2,2,2]')
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 44
- Joined: Fri Mar 16, 2007 5:51 am
-
- Participant
- Posts: 44
- Joined: Fri Mar 16, 2007 5:51 am
-
- Participant
- Posts: 44
- Joined: Fri Mar 16, 2007 5:51 am