The problem with subtracting datetimes directly is that you get back fractional days for the exact amount of time elapsed. So, If today = 2019-08-12 10:40 am and createddate = 2019-08-11 4:40 pm, you'll get 0.75 as the difference, since it has not yet been 24 hours. If you want to compare full days only, you have to use TRUNC to get rid of the time portion, so you are only comparing the dates.