diff --git a/hardwareAvailabilityReport.sql b/hardwareAvailabilityReport.sql index 25c1bd6..3ccc4e9 100644 --- a/hardwareAvailabilityReport.sql +++ b/hardwareAvailabilityReport.sql @@ -54,7 +54,7 @@ checks_with_prev AS ( SELECT *, LAG(status) OVER (PARTITION BY host_name ORDER BY check_time) AS prev_status, - coalesce(lead(check_time) OVER (PARTITION BY host_name ORDER BY check_time), date_trunc('day', check_time) + interval '1 day') AS next_check_time + coalesce(lead(check_time) OVER (PARTITION BY host_name ORDER BY check_time), now()) AS next_check_time FROM checks ),