Link to home
Start Free TrialLog in
Avatar of paulo111
paulo111

asked on

Date of Birth Formula

Hi Experts,

Been trying Ken Hamadys age calculation formula...

I get an error?

WhileReadingRecords;
DateVar Birth:= {sps_MIU_Ilkeston_crystal_template_data.child_dob};   // Replace this with your field for Date Of Birth
DateVar Ann := CurrentDate;  // Replace this with CurrentDate to get their age as of the time of the report
                                                            //or the date field of an event to get their age as of the time of that event.
if (Month(Ann) * 100) + Day (Ann) >=(Month(Birth) *100) + Day (Birth)  
then Year (Ann) - Year(Birth)  
else Year (Ann) - Year(Birth) -1

I get the error which prompts for a 'date is required here' in front of the {sps_MIU_Ilkeston_crystal_template_data.child_dob}
it is a datetime(8) in my sql sp!!
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

Glad i could help

mlmcc