Page 1 of 1

24 months back date from Current date

Posted: Wed Feb 22, 2006 3:41 pm
by Titto
Hi,

Need some information to get the 24 months back date from the current date. I need to use this date for filtering out the records which are older then 24 months.

any help is appreciated!

Thanks

Posted: Wed Feb 22, 2006 4:01 pm
by ray.wurlod
Split the date into year, month and day. Subtract 2 from the year. If the month and day are 2 and 29 subtract 1 from the day. Re-assemble date.

Posted: Wed Feb 22, 2006 4:55 pm
by kumar_s
Other option would be, convert it into Julian date and subtract two years of days from it. Leap year should also be taken care while subtacting.