Ask Search:
Angel EstremeraAngel Estremera 

30 Days future not reflecting today's date as True (1)

I create formula field to set True or False by 1 or 0. In this formula if I select the field "Preferred Start Time" to Today, the formula field called "Preferred Start Date NEXT 30 DAYS" is supposed to show 1 and is showing 0. What is wrong with this formula?

IF
(
(
DATEVALUE(Preferred_Start_Time__c) - TODAY()
)
>0
&&
(
DATEVALUE(Preferred_Start_Time__c) - TODAY()
)
<=30
,1,0
)
Best Answer chosen by Angel Estremera
Steve MolisSteve Molis
Try using 
IF
(
(
DATEVALUE(Preferred_Start_Time__c) - TODAY()
)
>= 0
&&
(
DATEVALUE(Preferred_Start_Time__c) - TODAY()
)
<=30
,1,0
)

 

All Answers

Steve MolisSteve Molis
( DATEVALUE(Preferred_Start_Time__c) - TODAY())
is essentially the same thing as saying  
( TODAY() - TODAY() )
and 
( TODAY() - TODAY() ) = 0 , not > 0
 
Steve MolisSteve Molis
Try using 
IF
(
(
DATEVALUE(Preferred_Start_Time__c) - TODAY()
)
>= 0
&&
(
DATEVALUE(Preferred_Start_Time__c) - TODAY()
)
<=30
,1,0
)

 
This was selected as the best answer
Magulan DuraipandianMagulan Duraipandian
So, today - today is 0 and 0 is not greater than 0. So it is working as per the formula field. Update the conditions properly to fix it.

Magulan Duraipandian
www.infallibletechie.com
Sedoud BoussadSedoud Boussad
Hi Angel,

Could you please reformulate your requirement, i'm not sure to understand.
If Preferred_Start_Time__c is equal to TODAY we display 1 right ?