Skip to main content
ashutoshg0001
Known Participant
Oct 21, 2021 1:05 PM UTC
Question

I want to compare date type value with dateTime type value ,how is it possible?

Hi i have a dropdown where i am selecting a date value from calendar , I have a date field in cdt with datetime type value .How can i make a comparision?

    2 replies

    stefanhelzle0001
    Brainy
    Oct 21, 2021 1:25 PM UTC

    You can cast a datetime into a date using todate().

    mikes0011
    Brainy
    Oct 21, 2021 1:28 PM UTC

    The exact answer really kinda depends on what you hope to accomplish.  How will a bare date be treated in comparison with a datetime?  If someone compares today's date versus today's date at 2 PM, for instance, should the comparison return tha they're equal, or that the value that's 14 hours after midnight be greater?  Or some other behavior?

    The Expression Guru