function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ran67ran67 

formula field to display the next date of birth of current year birth date

Hi

I have two field in the user.

one field is date of birth.its date field.

and another field is next date of birth its formula field.

now my scenario is suppose my date of birth is 05\08\1990

now in next date of birth field it must display the current year date of birth in next date of birth field=05/08/2012

can u please help me to display the like that.

thanks in advances

Best Answer chosen by Admin (Salesforce Developers) 
LogicRainLogicRain

DATE(YEAR(Today()), MONTH(birthdate field),DAY(birthdate field))

All Answers

ChrisB760ChrisB760

Date formula:

 

DATE(YEAR(birthdate field)+1, MONTH(birthdate field),DAY(birthdate field))

 

Replace "birthdate field" with the date field containing the persons birthday.

 

Any idea as to the answer to my question below yours? :)

 

ran67ran67

hi

its incrementing only one year ..of the date of birth.

but my requirement is used to display the current years date it must display.

suppose i have enter my date of birth=05/08/1990;

in  formula field  of next year date of birth it must display current year birthdate .05/08/2012

it must display like above

 

LogicRainLogicRain

DATE(YEAR(Today()), MONTH(birthdate field),DAY(birthdate field))

This was selected as the best answer
ChrisB760ChrisB760

Oh gotcha, then it has to be an IF statement that checks if their birthday has already occurred this year or not, and if it has, change the year to next year:

 

IF(DATE(YEAR(Today()), MONTH(birthdate field),DAY(birthdate field))<Today(),

DATE(YEAR(Today())+1, MONTH(birthdate field),DAY(birthdate field)),

DATE(YEAR(Today()), MONTH(birthdate field),DAY(birthdate field)))