Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Age in years months days

Status
Not open for further replies.

islesrock36

Programmer
Joined
Sep 8, 2009
Messages
1
Location
CA
I am currently doing a report where i have to display a persons age in years month and days.I have the year and months figured out but not the days.
heres what i have so far
NumberVar DoBVar := IIF((100 * MONTH({Command.HCA_ASSMNT_DTE}) + DAY({Command.HCA_ASSMNT_DTE})) < (100 * MONTH({Command.GET_DTE_BRTH(A.CLNT_ID)}) + DAY({Command.GET_DTE_BRTH(A.CLNT_ID)})), 1, 0);
NumberVar MthVar := (DATEDIFF("m",{Command.GET_DTE_BRTH(A.CLNT_ID)},{Command.HCA_ASSMNT_DTE}) - DobVar) mod 12;
NumberVar YrsVar := DATEDIFF("yyyy",{Command.GET_DTE_BRTH(A.CLNT_ID)},{Command.HCA_ASSMNT_DTE}) - DobVar;
StringVar MthYrs := TOTEXT(YrsVar,0) + " years " + TOTEXT(MthVar,0) + " months" ;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top