Today and 14 days ahead

Yeah, I think that gets a little hairy if you cross months and you’re working with numbers instead of dates. @Darren_Murphy has mentioned a few times that milliseconds can get in the way, so that’s why he converts them to numbers. I have a roundabout solution that should work and give you dates that are still actual dates, but the time is definitely midnight without worrying about milliseconds getting in the way.

The only part that’s not ideal is that you need a seed date. It can be any date, but the time has to be set to midnight. Then you can use it with some math to figure out the decimal portion of Now (hours/minutes/seconds/milliseconds) and subtract that from Now to get today’s date at midnight. It’s not bad, but it requires that extra seed date column, which is annoying.

now-((now-seed)-TRUNC(now-seed))

Once you have today’s date at midnight, then you can populate it across all rows and add the index number as Darren showed. All resulting dates will still be true dates.

4 Likes