Comparing and matching dates (with date and time format) with ToDate()

I’ve seen a few questions around comparing/matching dates, so I thought I’d create a simple doc demonstrating the ToDate() function to compare two dates.

If you have two columns with dates, and one or both of those columns are in the “Date and time” format, you’ll notice that comparing dates is not very straightforward (we’re working on making this easier!). Even if you change the column format back to just “Date,” the column still thinks it’s 4/8/19 2:00PM, for example, not 4/8/19. This means when you compare this column with another date column, it’s trying to compare the exact time and date, not just the date itself. To get around this, add the ToDate() function to your dates and this will just give you the date of that column, not the date and time.

7 Likes