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