+ Start a Discussion
Sachin P Sam 1Sachin P Sam 1 

How to set validation on Date/Time Field?

I need to ensure that the value in date/time should be betweeen 9 am and 9pm,how can i restrict other values, using validation rules.
Please Help.
Thanks in advance,
Regards,
Sachin
samyuktha reddy etikayalasamyuktha reddy etikayala
Hi Sachin,

Please find below code:

Time Portion = 
MID ( TEXT (My_Datetime__c ), 9, 9)

If its helpful for you, choose as best answer, further it can be helpful for other friends.


Thanks and regards,
Samyuktha.
Sachin P Sam 1Sachin P Sam 1
@samyuktha reddy etikayala,
i am using it in validation rule.
What is the Time portion there