Skip to main content
Hello, I need to create a field to show an image if the birthday is comming soon, the rule will be 2 weeks before show a green cake, 1 week before a yellow cake and the day d a red cake. I try with this formula but it doesn't work, can someone please help. 

 

Thanks 

 

IF(

 

(TODAY() - Birthdate_c ) <= 14 ,IMAGE("/birthday/birthday/cakeyellow.png"),

 

IF(

 

(TODAY() - Birthdate_c) <= 7 ,IMAGE("/birthday/birthday/cakeyellow.png"),

 

IF(

 

(TODAY() - Birthdate_c)= 0 ,IMAGE("/birthday/birthday/cakered.png"),NULL)))
5 respostas
  1. 15 de nov. de 2017, 12:53

    small cirrection the order should be other way for the IF statements

    IF((TODAY() - DATE(YEAR(TODAY()), MONTH(BirthDate__c),DAY(BirthDate__c))) = 0,

    IMAGE("/birthday/birthday/cakered.png", "cakered"),

    IF((TODAY() - DATE(YEAR(TODAY()), MONTH(BirthDate__c),DAY(BirthDate__c))) <= 14,

    IMAGE("/birthday/birthday/cakeyellow.png", "Yellow"),NULL))

    the above formula may not work if the Birthdate falls on LeapYear i.e. 29th of February

     

     
0/9000