Jump to content
Server Maintenance This Week. ×

Calculating age with a future date


This topic is 8671 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have created three fields and use the calculations that give me a persons age by year, by month and by day based on the date of birth I type in to the DOB field. This calculation (I assume) works off the computer's internal settings. What I now need to create are the calculations for a year, month and day age field that is based on a future date that I type in. For example, I know how old I am today, but how old will I be on November 11, 2005. Thanks for your help

Link to comment
Share on other sites

If you have already figured out how to find the age using DOB and today's date in the format that you want, then you already have the calculations you need.

Go into calculation you made already, copy it, paste into new box, replace Today with the name of a new field that holds Future Date.

Sample:

Old Calculation:

Year(Today) - Year (DOB)

New Calculation:

Year(Future Date) - Year (DOB)

------------------

Mikhail Petrovich Vimov

Link to comment
Share on other sites

Thanks for your help. The suggestion makes sense but I cannot get it to work.The formula I use to calculate age by year, month and day in three separate fields are:

FOR THE YEAR:

Year(Today) - Year(DOB 1) - If(Today< Date(Month(DOB 1),Day(DOB 1),Year(Today)),1,0)

FOR THE MONTH

Mod(Month(Today) - Month(DOB 1) + 12 - If(Day(Today) < Day(DOB 1),1,0),12)

FOR THE DAY

Day(Today) - Day(DOB 1) + If(Day(Today) >=

Day(DOB 1),0,If(Day(Today- Day(Today)) <

Day(DOB 1),Day(DOB 1),Day(Today- Day(Today))))

When I substituted my "Future Year" field for the word "Today" in YEAR CALCULATION the result was a negative number (-1992) The dates I am using are DOB 8-4-1995 which gives me an exact age today of 5 years. I used the future date of 8-4-2000 which should also produce an age of 5 years, but it creates a negative number of (-1992).

Can you clarify my error? Thanks.

Link to comment
Share on other sites

Michail. Thank you for your reply. I found the answer and the problem was my error. I was calculating the future date in three fields when all I had to do was type it into one future date field as you would a date of birth and then substitute that future date field in the calculation for the word "today" as you originally pointed out. I'm a slow learner. a secretary in my office has the summer responsibility of determining the exact age of 500+ children on the future date they are scheduled for an evaluation throughout the next nine months. Their age at the time of testing bears on the normed results. Normally the evaluator would complete this job, but alas, I am not King only a helping knave. Thanks for your help.

Bob Sherman

Link to comment
Share on other sites

First: Double check what you actually typed into year calculation again. If you copy exactly what you have written above into a field definition and then replace the field Today with Date field, it will work. I have just tried it to be sure.

Year(Date) - Year(DOB 1) - (If(Date< Date(Month(DOB 1),Day(DOB 1),Year(Date)),1,0))

Second: Filemaker does not understand dates as numbers. Therefore your Day calculation will not work since you want to subtract a number (Day(Today)) from a date (Today).

You will have quite a lengthy calculation to write for date if you really want to be exact to the day. The problem will be the irregular number of days in the months. You might want to think about rounding the month up or simply noting how many days you are short of a full month (i.e. 8 months 28 days would be 9 months when dealing with non-leap year February, 2 days short of a month for June, and 3 days short in December) However, it is easy enough to calculate how many days the date is short or past a month. Day(DOB) - Day (Date).

DOB :18 Nov 74

Day :7 Aug 00

25 Year 8 Month (9 days short of 9 mo.)

25 Year 9 Month (9 days short of month)

25 Year 9 Month (rounded up)

I am not certain exactly for what purpose you make these calculations so I don't know how necessary the Day calculation is to you. It can certainly be done: just a bit long.

I hope that this will help you: if I do not make clear my meanings let me know.

[email protected]

------------------

Mikhail Petrovich Vimov

Link to comment
Share on other sites

This topic is 8671 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.