cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Create Function that returns # days between two datetime fields, that ignores time portion of fields

Create Function that returns # days between two datetime fields, that ignores time portion of fields

The datediff function is based on time portion of datetime fields (and returns # of seconds). 

The weekdaysDiff function returns # of weekdays.

This is a very straightforward request:  we need a function that ignores the time portion of datetime fields and returns # DAYS between 2 dates (i.e. as weekdaysDiff does, and, as does Excel's DAYS(field1, field2).

 

If now() is used as one of the datetime fields in datediff function, from midnight to midnight of a given day, running a report or chart with the datediff function will return different values (i.e. as the seconds increase between now() and the other datetime field, eventually the calculated # of days will increase by 1).