ken1
1
Hi. I need to test if a date is before today. I will count today as starting at midnight.
I found this thread which helps:
But I can’t just subtract 24 hours.
Let’s say the current date/time is 5/7/2025 1:00 PM.
If the test date is 5/7/2025 1:00 AM, then this should count as today.
If the test date is 5/6/2025 11:00 PM, then this should not count as today.
But if I subtract 24 hours as the test, as in the example post, both of these will count as today.
Of course, I thought about using the date, but if I round down to a date and the month changes, then 5/30 should be less than 6/2, but 30 is not less than 2.
Is there some way to round a date to the month/day/year without the time and without losing the reference as a date? All of the solutions I can think of to get the format mm/dd/yyyy are formatting and do not change the actual date.
Thank you.
ken1
3
I thought if today is 5/7/2025 at 2:30 pm, if I round down to date the value is “7”.
Thank you. I appreciate the answer. I tested this and sure enough, I have 5/7/2025 12:00 am.
I was sure I’ve used this before and ended up with only the date this month, not the whole date. Maybe I used extract… instead.
Anyhow, this is exactly what I needed! Thank you.