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

Recommended Posts

Posted

We have a special needs class that has special services provided. These services are povided on a "Service Date".

I need to set another field based on the year of the Service Date (which is displayed as a normal date 7/1/2012),

I have tried

If [service Date= Year(Get(CurrentDate)]

Set Field [unit Count; Service Units]

but nothing happens. I thought this would check the Service Date field against the current Date/Year and if the year was part of the Service Date then the field would be set.

But it does not work.

Can someone assist?

Thank you,

Michelle

Posted

The expression in If [] compares a date ( Service Date) with a number ( Year ( Get ( CurrentDate ) ).

Instead, compare two numbers - the year of Service Date and the current year:

If [ Year ( Service Date ) = Year ( Get ( CurrentDate ) ) ]

Posted

If Unit Count is a calculation field ( or a number field with an auto-entered calculation), the correct syntax for the calculation is

If(Year(Service Date) = Year(get(CurrentDate)); ServiceUnits)

If this is a part of a script, the correct syntax is

If[Year(Service Date) = Year(get(CurrentDate))]

Set Field [unit Count; Service Units]

End if

Posted

Thank you both very much, It is now very clear :)

I finally gave up last night around midnight. Thanks again for all the help.

I am off to make a dontation to the FMForums Tip Jar!

Posted

You posted this in the calculation section, yet you are using a script syntax. Be aware of the difference. The current year is something that changes every January 1st. A calculation field - provided it's unstored - will evaluate anew on every screen refresh. Setting the field by script will store the result and leave it as is until you run the script again.

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