Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i need a formula to calculate the clients age in years and months in my rdlc report. I have the date of birth field.
Posted
Updated 7-Oct-16 4:03am

this will give the difference in year
round(DateDiff("m",fields!DOB.Value,Now() )/12)


and this will give the diff in month
DateDiff("m",fields!DOB.Value,Now() )
 
Share this answer
 
v2
Comments
Pratika05 5-Sep-12 7:34am    
thanks it helps
C#
=Floor(DateDiff("m",Fields!Birthdate.Value,Today())/12).ToString()+" Years " +(DateDiff("m",Fields!Birthdate.Value,Today())-(Floor(DateDiff("m",Fields!Birthdate.Value,Today())/12)*12)).ToString()+" Months"
 
Share this answer
 
v2
Comments
Member 13400977 28-Oct-17 1:18am    
Please provide it for Years, Months, Days,
This works even if your birthday is tomorrow

C#
=IIF(DateTime.Today<DateAdd(DateInterval.Year,DateDiff(DateInterval.Year,Fields!fechaNacimiento.Value,DateTime.Today),Fields!fechaNacimiento.Value),DateDiff(DateInterval.Year,Fields!fechaNacimiento.Value,DateTime.Today)-1,DateDiff(DateInterval.Year,Fields!fechaNacimiento.Value,DateTime.Today))
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900