Dates vs luxon dates

I see 2 méthods, and really only 1 that should be 100% reliable.

Turn your DateTime values into integers
@Darren_Murphy speaks about this often in the forum. It seems to be the most reliable method to work with dates and eliminate the time and therefore decimal portion of DateTime.

Use a math column: YEAR(DateTime)*10000 + MONTH(DateTime)*100 + DAY(DateTime) will give you a YYYYMMDD integer of DateTime.

Anchor the time portion of DateTime to midnight 00:00:00 (any other time would do, as long as it’s anchored and all DateTimes used the same anchor)

@Jeff_Hager discusses using a seed date to eliminate the time portion of DateTime. It might work for you. I don’t think this approach is as brute force as the integer approach.

3 Likes