getDuration function

Compute the difference in days between 2 variables in a database table.