How to add date constraint based on another field in the table

If we have birth_date and death date then birth_date<death_date. One way is to make sure that there is nothing common in the range we provide for two fields, is there any other better way?

try this —>
random(field(‘ExpiryDate’).raw + days(1), now()+days(6*365))