Jump to content

This topic is 7878 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Ok, I just don't get this stuff.

I have a date field - Inactive Date

I want to create a calculation field (Deletion Date) that will add 30 years to Inactive Date.

I can then use the Deletion Date in a start up script that will let me know when there are records that can be deleted.

The only way I know how to do this is to add 365*30 to the Inactive Date, but that doesn't include Leap Years. I tried to just add 30 to the date, but it returns days that way and not years.

Someone please end my torture. Thanks.

Posted

How does Date( Month( Inactive Date ), Day( Inactive Date ), Year( Inactive Date ) + 30 ) work for you?

Posted

Hi Raschelle,

Use the following calculation for your deletion date field:

Date( Month(Inactive Date), Day(Inactive Date) , Year(Inactive Date) + 30 )

This will add 30 years onto the date and leap years etc will be OK

For example if the Inactive Date is 29/02/2000 (a valid date as 2000 was a leap year)

Then the deletion date will be 01/03/2030 (as 2030 is not a leap year)

Ed.

Sorry Queue posted at the same time as you - it seems I'm making a bit of a habit of this at the moment - must speed up my typing skills!

Posted

Interestingly enough, that also gives 03/01/2000's Deletion Date as 03/01/2030. Is this a problem?

Posted

Hey, we had the same answer anyway. I just aced my typing classes in high school. grin.gif

Posted

Thanks -Queue- and EddyB. That's just what I needed.

Maybe someday I'll be posting answers instead of questions. grin.gif

Posted

No problem Raschelle.

The more you ask, the more you learn, the more you can answer others questions!

I was the same when I joined the forum! We all still ask questions though, there's always more to learn!

Ed.

This topic is 7878 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.