Create a formula in Report to calculate Age from Birthdate #inSalesforce
Create a formula field returning Number
CASE(MONTH(TODAY()) - MONTH( User.Birthdate__c ),
0,
IF(DAY(TODAY()) >= DAY(User.Birthdate__c), YEAR(TODAY()) - YEAR(User.Birthdate__c), YEAR(TODAY()) - YEAR(User.Birthdate__c) - 1),
IF(MONTH(TODAY()) < MONTH(User.Birthdate__c), YEAR(TODAY()) - YEAR(User.Birthdate__c) - 1, YEAR(TODAY()) - YEAR(User.Birthdate__c))
)
0,
IF(DAY(TODAY()) >= DAY(User.Birthdate__c), YEAR(TODAY()) - YEAR(User.Birthdate__c), YEAR(TODAY()) - YEAR(User.Birthdate__c) - 1),
IF(MONTH(TODAY()) < MONTH(User.Birthdate__c), YEAR(TODAY()) - YEAR(User.Birthdate__c) - 1, YEAR(TODAY()) - YEAR(User.Birthdate__c))
)
Comments
Post a Comment