I have two Date/Time fields that need to compare, ON my validation Check-Out time must be greater than check-in time.

How to compare them in the validation rule?

CheckIn_Time (Date/Time)
CheckOut_Time (Date/Time)

I have tried the below rule, it compares the only date not time

DATEVALUE(CheckIn_Time__c) > DATEVALUE(CheckOut_Time__c)

  • 3
    What have you tried that has not worked?
    – Moonpie
    Commented Aug 25, 2021 at 16:42

1 Answer 1


Simple arithmetic operators work when comparing a Date/Time to a Date/Time.

You must do conversions or other operations to extract the parts you need if you want to compare Date to Date/Time.

This Validation Rule: CheckOut_Time__c <= CheckIn_Time__c

Resulted in this:

enter image description here

and this:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .