Why the If function?
Date ( Month ( DateOfHire ) + 3 ; Day ( DateOfHire ) ; Year ( DateOfHire ) )
The date function will automatically adjust to compute correct dates for hire dates at the end of the year to produce dates in the start of the next year.
Thanks PhilModJunk for the quick reply! This does get me a step closer. To answer your question, I'm not interested necessarily in the actual date but I want to return a value if the employee has exceeded three months of employment.
Can I use this function to do the following? (for example):
IF(TodayDate >= Date ( Month (DateOfHire) + 3 ; Day (DateOfHire) ; Year (DateOfHire)) , $1000 , $500)
Use Get ( CurrentDate ) in place of "TodayDate" and this will work as a script step or as an unstored calculation field. I won't update if you use a stored calculation or auto-entered calculation.
Thanks. Here is a copy of my function below. Whenever I run it, it returns the same 500 even if the hire date is within 3 months.
If ( Get ( CurrentDate ) ≥ Date ( Month ( DateOfHire ) ; Day ( DateOfHire ) ; Year ( DateOfHire ) ); 500 ; 250 )
Any suggestions? The calculation is also unstored.
Oh Nevermind! Forgot to put the + 3!
It works now. Thanks for the help!
Make sure that DateOfHire is of type Date and has the correct date in it. If DateOfHire is a calculation field, make sure that "date" is selected as the result type.
You might put
Date ( Month ( DateOfHire ) ; Day ( DateOfHire ) ; Year ( DateOfHire ) )
into a calculation field and place it on your layout in order to check and see what date is actually being calculated.
If you have FileMaker advanced, you can put that expression in the data viewer instead of adding a new field and then you can check the value that it is calculating that way.