etsmarines Posted October 14, 2010 Posted October 14, 2010 I have a personell management file that keep track of school faculty and staff. I have a field on the form called hire date. I have another field called years of service that show how many years the member has been with the school. I want that years of service field to relate to the hire date and automatically update the number of years of service so i dont have to do so manually. How do I go about doing so? Thanks For The Help!! Erik
LaRetta Posted October 16, 2010 Posted October 16, 2010 Your Years Of Service field should be a calculation (result is date) as: Let ( [ now = Get ( CurrentDate ) ; this = Date ( Month ( HireDate ) ; Day ( HireDate ) ; Year ( now ) ) ] ; Year ( now ) - Year ( HireDate ) - ( now < this ) ) // END LET When you create this calculation (and you are still in the calculation dialog, go into Storage Options and select the checkbox 'do not store calculation results.' This is required so the calculation updates every time it is accessed.
comment Posted October 16, 2010 Posted October 16, 2010 Your Years Of Service field should be a calculation (result is date) Your fingers slipped: result type should be Number.
LaRetta Posted October 16, 2010 Posted October 16, 2010 (edited) Thank you but I think it was that my mind slipped. BTW, someone could also use Ray's trickery calc for the test whether full year has lapsed, which is if IIRC: Month ( now ) + Day ( now ) / 100 < Month ( HireDate ) + Day ( HireDate ) [color:red]/ 100 Edited October 16, 2010 by Guest forgot red
Recommended Posts
This topic is 5153 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 accountSign in
Already have an account? Sign in here.
Sign In Now