Calculate Date of Birth in SSRS

You can utilize this code in an Expression to find the Date of Birth.
=IIF(IsNothing(Fields!dateofbirth.Value), "",
IIF( ((Month(Now) - Month(Fields!dateofbirth.Value)) < 0) 
OR ((Month(Now) - Month(Fields!dateofbirth.Value)) = 0 
AND (Day(Now) - Day(Fields!dateofbirth.Value)) < 0), 
(Year(Now) - Year(Fields!dateofbirth.Value)) - 1,
(Year(Now) - Year(Fields!dateofbirth.Value))
))

Comments

Popular posts from this blog

Add User As Local Administrator On Domain Controller

Calling Dataverse Web API in PowerShell using Client Credentials

Windows Server 2008R2 VMs Shut Down After 1 to 2 Hours