@Tom wrote:
You need to know your data.
Do any of the values in the dataset have non zero time of day parts?
Note that '31DEC2023:08:00:00'dt is greater than '31DEC2023:00:00:00'dt so filtering on values between '01DEC2023:00:00:00'dt and '31DEC2023:00:00:00t'dt will miss most of the values on the last day of the month.
For the above solution, I point out that the value of &last_day_of_previous_month is 2019686399 which turns out to be 31DEC2023:23:59:59 (if run on 03JAN2024, so this handles the case you mention.
... View more