Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hi everyone... got a simple yet no so simple question... what would be the script to add a year minus one day to a date? Like in insurance policies which expire one year less a day from the day you bought it? Seems complex because some months have 31 days.. some 30, some 29 on leap years n 28 on other....

Thanks!

Posted

CAN YOU JUST ADD 364 DAYS...?? Please show your script so we can help you..

Posted

Actually, adding 364 days is not the answer due to leap years. Try adding:

Date ( Month ( StartDate ) ) ; Day ( StartDate ) ; Year ( StartDate ) ) -1

where: StartDate is the start of the policy.

Posted

Small change - you forgot to add one year. :^)

Date ( Month ( StartDate ) ; Day ( StartDate ) ; Year ( StartDate ) + 1 ) -1

  • Like 1
Posted

OK, revision, this seems to work, let me know..

Case(

Day ( startdate-1 ) >Day ( startdate ) ; Date ( Month ( startdate )-1 ; Day ( startdate-1 ) ; Year ( startdate ) +1);

Day ( startdate-1 ) < Day ( startdate );Date ( Month ( startdate ) ; Day ( startdate-1 ) ; Year ( startdate ) +1))

Posted

You missed adding a year and you have an extra ) after month

Date ( Month ( AnyDate ) ; Day ( AnyDate ) ; Year ( AnyDate ) + 1) -1

update, must be a slow day around the offices. LOL :giggle2:

  • Like 1

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