Days between date and now

Hi everyone,

I cannot seem to work out how to calculate the number of days between a date and the current date.
If I am doing it correctly it is coming back as a duration. Can this be converted in a simple integer number of days?

Hi @SKETCHwade ,

Could you please elaborate what expression and column types you are using and what result you are getting ?

Typically , we get number of days between two dates by using an expression something like HOUR([End Date]- [Start Date])/24

1 Like

Thanks for this interesting solution, @Suvrutt_Gurjar! When I first saw the answer, I became concerned that the time that the date was recorded might affect the result. Now I see, though, that as long as you make sure your are dealing with just dates and not dates and times, it works perfectly. For example, the following yields the number 1, as it should, even though only an hour has elapsed:

hour(DATE(“12/12/2019 00:30:00”)-DATE(“12/11/2019 23:30:00”))/24

Counting weekdays or workdays is more complicate but @LeventK has already written about that:


H @Kirk_Masden,

Thank you for useful reference. @LeventK 's solutions are always interesting and educating.

In this case, it is not exactly specifically my solution, the approach is already documented in the following AppSheet article. At the most, I may say I just remember it after having used it a few times.

Please look at the first example in section
## “Examples that Compute Durations in Days, Months, or Years” in the article below