Contains( "9/20/22" , "8/20/22 ) , would it return true?

Would number 20 fragment ever return true when comparing 2 dates with Contains()?

I have a formula that is working correctly, but I'm afraid that this would ever return true in a case like this. I tested it and it did not come true, stays false. But shouldn't the two 20's return true?

0 4 96
4 REPLIES 4

It's unclear what you're trying to ask or accomplish.

Maybe test and compare each of the following to see whether the results help you understand what you're trying to figure out regarding the CONTAINS function.

Contains( "9/20/22" , "8/20/22" )

Contains( "9/20/22" , "20" )

 

Ok, I get it now. Thanks dbaum. So basically the only time it would come back true is only if the dates match correct?


@casitasrd wrote:

the only time it would come back true is only if the dates match correct?


Correct.

CONTAINS evaluates to TRUE only when the entire text of the second parameter is contained within the first parameter.

So in the case you mentioned, this never evaluates to TRUE.

If you want to see if "20" is contained in the first parameter, you should use

  • CONTAINS([date to be compared to], "20").

If you are checking if two dates are of the same day then you can use the expression

  • DAY([date 1]) = DAY([date 2])
Top Labels in this Space