Comparing Date field with Today's Date

Hi.

What would be the correct expression to compare if the DD/MM part of a date column, say [Start Date], was equal to Today’s DD/MM?

Thanks.

IF( [Start Date] = Today(), “Yes”, “No” )

left(([start date] & ""), 5) = left((today() & ""), 5)

4 Likes

Thank you @Steve

1 Like

Did you use the & in here as a quick way to apply CONCATENATE() or TEXT() expression to the dates?

1 Like

([start date] & "") is equivalent to CONCATENATE([start date], ""). Both convert the Date value in its raw form to a Text value. Where you to use TEXT([start date]), it would convert the Date value to Text, but would reformat the date according to the current locale, rather than keeping the raw form.

1 Like

I love this hack. Thanks for sharing, Steve. It’s really clever! It was hard for me to find details about what the & character does as it’s not an expression. Are their other characters that can be used like this outside of expressions and, if so, how would I find more info on them?

& is an operator, just as +, -, =, *, /, <, >, <=, and >= are.

See Constructing a Textual Value with Concatenation here for the documentation we have on &: