diff --git a/onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql b/onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql index f476894d3..2c530c3ef 100644 --- a/onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql +++ b/onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql @@ -26,4 +26,5 @@ and this one: <= NOW() → not in the future Together, they produce exactly the last 24 hours, nothing more. */ WHERE CAST(enddate AS DATE) = TIMESTAMPADD('SQL_TSI_DAY', -1, CAST(NOW() AS DATE)) - AND CAST(enddate AS DATE) <= CAST(NOW() AS DATE) \ No newline at end of file + AND CAST(enddate AS DATE) <= CAST(NOW() AS DATE) + AND Id.demographics.calculated_status = 'Alive' \ No newline at end of file