PDA

View Full Version : calculated field (calculate Age)


helpless
July 29th, 2002, 11:03 AM
I have a field for DOB (MMDDYY). How can I create a calculated field in the model to give the age base on todays date? :confused:

helpless
July 29th, 2002, 12:02 PM
Part two. In the report I am using the date is shows up as 120335. When I change the format to date it shows as 12/3/2035. It does not do this for every line???? any suggestions????

helpless
July 29th, 2002, 12:05 PM
Part three... the only time this year change occurs is for dates where the year is 1949 or less. Is this a Y2K conversion thing?

Sandy McQuay
July 30th, 2002, 10:54 AM
In Monarch under Options -> Input... you can set the date range for 2 digit years. The default is 1950 - 2049. Which means any 2 digit year before 50 will be "translated" as the year 2000 (i.e. 120335 will be 12/03/2035).

Gareth Horton
July 30th, 2002, 11:12 AM
Hi

Since you are probably using 2-digit dates before 1950, then you should make sure that your 2-digit date translation window is correct.

Go into Options | Input and change the value for "Date Range for Two Digit Years" to the right 100-Year window you need.

As regards finding the Age, then a formula like this will help, but is not exact.

int((Today()-BirthDate)/365.25)

Bruce
March 4th, 2004, 08:45 PM
I know this is an OLD post, but I found this formula to do this.

IF(MONTH(TODAY())>MONTH([Birth Date]),YEAR(TODAY())-YEAR([Birth Date]),IF((MONTH(TODAY())=MONTH([Birth Date]) .and. DAY(TODAY())>=DAY([Birth Date])),YEAR(TODAY())-YEAR([Birth Date]),(YEAR(TODAY())-YEAR([Birth Date]))-1))

Steve Caiels
March 10th, 2004, 10:37 AM
Hi,
The following formula will give a correct age.
if(
(month(dob)*100)+day(dob)<(month(date())*100)+day( date()),
year(date())-year(dob),
year(date())-year(dob)-1)
)The condition multiplies the month by 100 and adds the day of the month to give a value that can be compared to todaus date to see if it has passed or not (ignoring the year)

Regards
Steve