Pesky Date Question

From: Ken Halsted <kenman_at_mail.snider.net>
Date: Tue, 15 Jun 1999 12:08:00 -0500
Message-ID: <929466546.977.6_at_news.remarQ.com>



Question to Oracle Guru's,

Is there a way to fix the following code so that it is more accurate.

txt := to_char(cyb_rec.seniority_date,'MMDD')||to_char(sysdate,'YYYY'); -- txt is a VARCHAR2
 lv_anniv_start := to_date(txt,'MMDDYYYY'); -- lv_anniv_start is a DATE

Those two lines are part of my code now and the problem is if the employee's seniority_date is '02291996', I get an error because there is no 02291999.

All I need is a way to convert a persons seniority_date (hire_date) to the current year. For example, If I was hired on 02/29/1996, I want to convert it to 02/28/1999 or 03/01/1999, whichever makes the most sense.

Please help.

Thanks,

Ken.

--
_________________
Kenneth W. Halsted
Mountaire Corporation
ph: (501) 399-8812
url: http://www.mountaire.com
email: kenman_at_mail.snider.net
Received on Tue Jun 15 1999 - 19:08:00 CEST

Original text of this message