Hi robertw937098
Date Difference could be calculated as: SELECT DATEDIFF(day, 'yyyy-mm-dd hh:mm:ss', 'yyyy-mm-dd hh:mm:ss');
PostgreSQL allows you a more accurate difference like (3 days, 10 hours) using the 'timestamp' option as below:
SELECT 'yyyy-mm-dd hh:mm:ss'::timestamp - 'yyyy-mm-dd hh:mm:ss'::timestamp;
'DATE_PART' prefixed to the above will again give difference in days.
SELECT DATE_PART ('day', 'yyyy-mm-dd hh:mm:ss'::timestamp - 'yyyy-mm-dd hh:mm:ss'::timestamp);
Hope that helps!