Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Try Interval() function.
try
fabs(Date(Field1,'DD/MM/YYYY')) - fabs(Date(Field2,'DD/MM/YYYY'))
Dates are numeric values in days, times are fractions of a day, so:
=Date1 - Date2 // will give number of days (including fractional amount for the time difference if any
=Floor(Date1) - Floor(Date2) // number of days disregarding time differences
Also
=(Date1 - Date2) * 24 // differences in hours
=(Date1 - Date2) * 24 * 60 // differences in minutes
Interval() can format the day and time differences
=Interval(Date1 - Date2, 'dd hh:mm') // displays time differences in hh:mm format
HTH
Jonathan
Manoj K wrote:
fabs(Date(Field1,'DD/MM/YYYY')) - fabs(Date(Field2,'DD/MM/YYYY'))
Date() is a formatting function - it does not affect the value. If Field1 and Field2 are dates, then Date() here will do nothing except waste time. If Field1 and Field2 are strings, then you should use Date#() which is the date interpretation function.
Dates would not usually be negative (unless they are before 31 December 1899), so fabs() will also not do anything useful here.
So if the values are dates, then that expression is the same as =Field1 - Field2