Jump to content

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

Recommended Posts

Posted

I tried to download the sample files from that section of the forums, but all i get are garbles text files on my mac. So apologies in advance for asking silly questions that i'm sure have been covered over and over agian.

I got a date field called "DATE". I want to add 5 to the year so i can show the ammortization date in field "AMDATE". So if DATE = 2/2/2002 then AMDATE = 2/2/2007.

I know this must be simple, but i cant get it.

Thanks,

Steve

Posted

Hi Steve,

Make your field calculation.

AMDATE Calculation result date

DATE + 1800

HTH

Lee

smile.gif

Posted

Lee. I did as you suggsted, though i still dont follow the logic. How's adding 1800 to the date going to add 5 to the year?

anyway, i tried it to see.

AMDATE = DATE + 1800

When DATE field had 3/3/2003 entered, AMDATE resulted with 733077. Not sure what I missed here.

Posted

This calculation is in the Sample file by Russ Baker - Handy Bits and may be a lot more closer to what you want.

Date( Month(DATE) + 60, 1, Year( DATE) )

The difference was 1 day June 30 mine, July 1, his.

HTH

Lee

Posted

Your answer is that the field is showing the result of NUMBER, and should be DATE. This option is at the bottom of the Calculation Box. Also, 5 years equals 1800 days.

The calculation I just gave you for Russ is also result of Date

Lee

laugh.gif

Posted

You can also just add 5 to the years - like:

= Date(Month(DATE), Day(DATE), Year(DATE)+5)

However, if your start date is 29 Feb in a leap year (say 2004), then this calc will default to 01 Mar 2009 because there is no 29 Feb 2009. If you want it to return 28 Feb 2009 instead or 01 Mar 2009, then you need to use this calc:

Case(

Day(Date(Month(DATE), Day(DATE), Year(DATE)+5)) <> Day(Date(Month(DATE), Day(DATE), Year(DATE))),

Date(Month(DATE)+1, 0, Year(DATE)+5),

Date(Month(DATE), Day(DATE), Year(DATE)+5)

)

You could cut this calc down if you knew it was always going to be 5 years - becase if it was 5, then a start date of 29 Feb in a leap year would never result in a finish date in a leap year, but the above version is better because it will work for any number of years, if you decide to change the "5".

Posted

I tried to download the sample files from that section of the forums, but all i get are garbles text files on my mac

This is a quirk in the way this bulletin board software works. The downloaded file is correct but has the wrong file type. Just drag and drop the file onto Stuffit Expander and it should decompress into a Filemaker file.

This topic is 7989 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.