December 21, 200421 yr Hello, I searched the forum but cannot find any notes on how to calculate a person's age based on his/her birthdate. I also cannot find this in any of the documentation I have which is surprising as I thought this particular calculation would be very commonly used. How would I do this? Thanks! rlbryant
December 21, 200421 yr What previous post? It is helpful to Post the URL to whatever post you are referring to. Lee
December 21, 200421 yr Year(Get(CurrentDate)) - Year(DOB) - (Get(CurrentDate)< Date(Month(DOB); Day(DOB); Year(Get(CurrentDate))))
December 22, 200421 yr Stick with Queue's calculation, tranpower's has flaws. As almost all attemps at this calculation have.
December 22, 200421 yr That one doesn't work if you were born between the first and twenty-eighth of February during a non-leap year and today is your birthday.
December 24, 200421 yr Ralph: Please provide one or more counterexamples to the function I gave, if you can, so we can all learn.
December 29, 200421 yr Author Thank you very much to everyone who responded. I have this working now in a test system. rlbryant
January 4, 200520 yr I have this equation and it does work, when you are typing in for the frist time... But I have noticed that the age does not change when a birthday passes. Have I done something wrong? Joseph
January 4, 200520 yr The calculation needs to be "Unstored". That is an option provide in the Calculation Window (at least it was in v6 and before). Lee
January 5, 200520 yr Ok, I went into the calc, under storage options and marked do not store anything... But the age did not change? How do I go back through the data base and refresh all for the age? Thank you for the help, Joseph
January 5, 200520 yr Joseph, is your field a date field, number field or calculation? I think you have it set to either a date type field or a number, then you are putting that calculation in the "auto-enter" area. Change the field type to a calculation.
January 5, 200520 yr At the bottom there is a menu that defaults to number. Change it to Date and see that does it for you.
January 5, 200520 yr The answer is a truncated 2 digit age -- like 71... it is generated by this equation: Case(IsEmpty(Ins_DOB);"";Truncate((Current_Date-Ins_DOB)/365.25;0)) Any idea's? Joseph
January 10, 200520 yr Use the calc I posted already. It is more accurate and no truncating is necessary.
January 10, 200520 yr Ok, so I now am using your equation Queue: Year(Get(CurrentDate)) - Year(DOB) - (Get(CurrentDate)< Date(Month(DOB); Day(DOB); Year(Get(CurrentDate)))) On my form this is a calc and a number... Does this mean that the age will increase when his birthday passes? Thank you for the help Joseph
January 13, 200520 yr Newbies How do I calculate Age from a Date of Birth field and a Date of Death field - ie not using current date
January 13, 200520 yr Use Date of Death instead of Get(CurrentDate). I believe this calculation can be stored.
January 14, 200520 yr Newbies Hi, I am trying to work with the code that is being given here and I haven't had success in making it work. I have a field that calculates the equation that was given by the user Queue but I cannot modify the field when I create a record so I do not know how I am suppose to pass a date in order for the calculation to render the number for age. The field which type is Calculation has the equation: Year(Get(CurrentDate)) - Year(DOB) - (Get(CurrentDate)< Date(Month(DOB); Day(DOB); Year(Get(CurrentDate)))) Calculation result is number The above is not working. I've also tried to make the field type number, with the Auto Enter Calculate checked which to I then place the equation which allows me to modify the field, but then the calculation is wrong. Any ideas?
January 14, 200520 yr DOB is the Date of Birth field. Once you fill that in, there is no need to pass a date since it naturally passes itself. Calculation fields are not intended to be modified, nor is there any reason to do so in this case. Make sure the calculation is unstored in Storage Options (select 'Do not store calculation results') or the field will not update when the date on your system changes.
Create an account or sign in to comment