September 10, 201411 yr Some years ago I took a standard inventory file and have used it since. It is very good. You enter the date purchased and one of the fields calculates the age in years. It is not working and the formula is beyond my expertise. This is the formula; If( GetAsText( Year(Get(CurrentDate)) - Year(Date Purchased) ) = "1"; GetAsText( Year(Get(CurrentDate)) - Year(Date Purchased) ) & " Year"; GetAsText( Year(Get(CurrentDate)) - Year(Date Purchased) ) ) I would be grateful if anyone could advise what changes I should make to get the field to work properly. Thanks
September 10, 201411 yr Hi Scrim, and welcome to the FM Forums, I moved your topic from "FileMaker Pro 11" to "Calculation Engine (Define Fields)” because the General topics are reserved for discussion of the new tools, features, and functions that were new in that release of FileMaker, and not for asking how-to questions.
September 10, 201411 yr It is both unnecessarily complicated and inaccurate (not taking in account the month and the day), but still - what's "not working"?
September 11, 201411 yr Author The field that should show age, is not showing anything at all, and for entries made some years ago, it is not giving the correct answer.
September 11, 201411 yr Make sure that the field is a calculation field and that it is set to 'Do not store calculation result...' in Storage Options.
September 11, 201411 yr Author Thanks very much, setting that option has fixed it. I really appreciate your time and knowledge
September 11, 201411 yr Now that you have that fixed, I suggest you change the formula to a much more simpler = Year ( Get (CurrentDate) ) - Year ( Date Purchased ) and set the result type of the calculation to Number. Having the units in the same field as the numeric value is not good practice. Note that we are assuming here that this is a fiscal calculation (i.e the exact date of the purchase is irrelevant), and that your fiscal year corresponds to the calendar year. IOW, an item purchased on December 31, 2013 is one year old on January 1, 2014.
Create an account or sign in to comment