How to compare two dates?

Hi all, I am having an issue comparing two dates using @DateTime.CompareDates(DateA, DateB) function.

In the requirement, both DateA and DateB are from clipboard, but to simply the problem, I use a constant for DateB.

If I do @DateTime.CompareDates (20220101, 20190101), it will return true, which is good, but if I set my DateA (I named it “EffDate” to be 20300101, then compare them @DateTime.CompareDates(.EffDate, 20190101), it’s returning false.

They both should return true but the second one returns false :frowning:

Could anybody help me figure this problem out? Much appreciated!

@ChensuZ5

This problem is solved. I did not know I should put double quotation around the hardcoded date like this “20190101”