Mar 25, 2003 #1 EdRev Programmer Aug 29, 2000 510 US The format of my sysdate is in 'DD-MON-YY' (i.e 25-MAR-03). I want to extract the following rom this date string. strMonth = MAR intMonth = 03 strYear = 2003 intYear = 3 Can anybody show me the function(s) to do the above including the declaration section.
The format of my sysdate is in 'DD-MON-YY' (i.e 25-MAR-03). I want to extract the following rom this date string. strMonth = MAR intMonth = 03 strYear = 2003 intYear = 3 Can anybody show me the function(s) to do the above including the declaration section.
Mar 25, 2003 1 #2 51m0n Programmer Jul 3, 2002 28 IT try this (i did not test it, writing it on the fly): declare strMonth varchar2(3); intMonth number; strYear number; intYear number; begin strMonth := to_char(sysdate, 'MON'); intMonth := to_char(sysdate, 'mm'); strYear := to_char(sysdate, 'yyyy'); intYear := mid(to_char(sysdate, 'yy'), 2, 1); end; -- regards, Simon Upvote 0 Downvote
try this (i did not test it, writing it on the fly): declare strMonth varchar2(3); intMonth number; strYear number; intYear number; begin strMonth := to_char(sysdate, 'MON'); intMonth := to_char(sysdate, 'mm'); strYear := to_char(sysdate, 'yyyy'); intYear := mid(to_char(sysdate, 'yy'), 2, 1); end; -- regards, Simon
Mar 25, 2003 Thread starter #3 EdRev Programmer Aug 29, 2000 510 US Thanks a lot Simon! Upvote 0 Downvote