Date Difference
Returns the integer number of Date Part intervals by which Date 1 (rounded down to the nearest Date Part) is less than Date 2 (rounded down to the nearest Date Part). For example, the difference between 05/12/05 05:32 PM and 05/15/05 04:47 PM with Date Part set to d (for day) returns 3.
Arguments
This function has the following arguments:
Date 1: Text string specifying the earlier date. It must be either a formatted date/time string or a Java standard date/time argument in milliseconds from Jan 1, 1970.
Date 2: Text string specifying the later date. It must be either a formatted date/time string or a Java standard date/time argument in milliseconds from Jan 1, 1970.
Date Part: Text string that specifies the date part with respect to which the difference is to be calculated. Specify s, m, h, d, w, M, q or y for seconds, minutes, hours, days, weeks, months, quarters or years.
The function returns a number.