hours between dates sql code example Example: SQL: calculate hours from two dates DATEDIFF(second, start_date, end_date) / 3600.0