Hello,
I am using age formulas in a report which work very well. How can I add on to the formulas below to specify years, monthes, weeks, and days old? Ex.: Little Bobby is 7 years, 8 months, 3 weeks, 2 days old today!
Thanks!
Risman
If Month({table.dob}) <= Month(CurrentDate)
and
Day({table.dob}) <= Day(CurrentDate)) then
Year(CurrentDate) - Year({table.dob})
else
Year(CurrentDate) - Year({table.dob})) – 1
WhileReadingRecords;
DateVar Birth:= {DOBField};
DateVar Ann:=CurrentDate;
if (Month(Ann) * 100) + Day (Ann) >=(Month(Birth) *100) + Day (Birth)
then Year (Ann) - Year(Birth)
else Year (Ann) - Year(Birth) -1
I am using age formulas in a report which work very well. How can I add on to the formulas below to specify years, monthes, weeks, and days old? Ex.: Little Bobby is 7 years, 8 months, 3 weeks, 2 days old today!
Thanks!
Risman
If Month({table.dob}) <= Month(CurrentDate)
and
Day({table.dob}) <= Day(CurrentDate)) then
Year(CurrentDate) - Year({table.dob})
else
Year(CurrentDate) - Year({table.dob})) – 1
WhileReadingRecords;
DateVar Birth:= {DOBField};
DateVar Ann:=CurrentDate;
if (Month(Ann) * 100) + Day (Ann) >=(Month(Birth) *100) + Day (Birth)
then Year (Ann) - Year(Birth)
else Year (Ann) - Year(Birth) -1