January 17, 200521 yr I already have the calculation for age but I want the calculation to appear in months instead of years so that I can figure out Vacation Time. Example: Current Date = field 1 Date of Hire = field 2 Total Months = field 3 (Calculation that I can't figure out) Vacation = field 4 (calculation = vacation *.875) in months Thanks in advance for all your help
January 17, 200521 yr Try this: Case( not IsEmpty(Current Date) and not IsEmpty(Date of Hire) and (Current Date >= Date of Hire) ; 12 * (Year(Current Date) - Year(Date of Hire) - ( Current Date < Date( Month(Date of Hire) ; Day(Date of Hire) ; Year(Current Date) ) ) ) + (Mod( Month(Current Date) - Month(Date of Hire) + 12 - ( Day(Current Date) < Day(Date of Hire) ) ; 12 ) ) )
January 19, 200521 yr Author Ralph, I tried it and when I put in the current date of 06/01/2000, it comes up 47 months. That is about 6 months short. There has to be a way. I copied exactly the calcuation and pasted it into the field and that's what I got.
January 19, 200521 yr I get 55 months with the calculation copied from the post and pasted into FMP. 6/1/2000 to 1/1/2001 is 7 months. 1/1/2001 to 1/1/2005 is 4 years = 48 months. 48 + 7 = 55. 6/1/2000 is Date of Hire & Current Date is 1/19/2005.
January 19, 200521 yr Author I must have something else wrong then. I keep coming up with 47 with the exact same script. Like I said, I cut and pasted it into the field and that is what I get. Will look at it again.
January 20, 200521 yr Author That is what I was using also but when I put in the field to show up the current date is was 8 months. I deleted the field and put it back in and it is now working perfectly. I guess that it was just some sort of bug. Not sure what was going on with this as it has happened before with other dates. Thanks Ralph. Your calculation did work in the first place. I should have checked into this first.
January 20, 200521 yr Have you set the current date to be unstored? It needs to be unstored or it will remain at the date the record was created.
Create an account or sign in to comment