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 5775 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Case(IsEmpty(Date Inspected) or IsEmpty(Frequency); GetAsDate(""); Date(Month( Date Inspected); Day(Date Inspected);Year(Date Inspected)+Frequency))

I am using version 8

I have not used fmp for a while am a little rusty.

The above code calculates a date from the date Inspected and add's the number of years to it and places the result into the field called Due date.

However when i set it up i set the Frequency to be years instead of months, but i cannot seem to get the result to revert to add in months instead of years.

So if the user puts today's date as the Inspection date, and 3 in the Frequency, the result should be 31/6/09, but i get 15/3/2012.

How can i change it to months instead?

Corey....

Posted

I think your example dates have a typo or two in them.

Date (Month (InspectionDate); Day (InspectionDate); Year(InspectionDate)+Frequency)

Lee

Posted

The example

dates the result should be 31/6/09, but i get 15/3/2012
should be 30/6/09. The 15/3/2012 is correct, as it was adding 3 years to today's date instead of months.

I managed to get a rough & ready result by using this

Case(IsEmpty(Date Inspected) or IsEmpty(Frequency); GetAsDate(""); Date(Month( Date Inspected); Day(Date Inspected);Year(Date Inspected)))+(Frequency*30.44)

I am after an exact calculation for months instead of my crude (*30.44) bit to divide the Frequency years into months.

Lee, that code you posted is the same as the code i posted ?

Corey....

Posted

You mean comment, he beat me to the punch again. LOL

Lee

Ahh yes i did.

Opps.

Quick question: can a Script be run from a Calculation, or only a Calculation run from Script ?

ie. If field [Due date] <= Today, then run a script to send an email.

Corey....

Posted

You can use a check with an opening script. Find those with Due date <= Today and then loop through.

BTW, if you upgrade to FM10, you can use SMTP email directly from FM without using an email client. You can also use script triggers to auto send the email when a user changes the date in the field or when going to a record, etc.

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