Skip to content

Commit 204f5ee

Browse files
committed
Added clause to exclude dead animals in a query
1 parent 33811ef commit 204f5ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

onprc_ehr/resources/queries/study/AssignmentsReleasedInPast1Day.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ and this one: <= NOW() → not in the future
2626
Together, they produce exactly the last 24 hours, nothing more.
2727
*/
2828
WHERE CAST(enddate AS DATE) = TIMESTAMPADD('SQL_TSI_DAY', -1, CAST(NOW() AS DATE))
29-
AND CAST(enddate AS DATE) <= CAST(NOW() AS DATE)
29+
AND CAST(enddate AS DATE) <= CAST(NOW() AS DATE)
30+
AND Id.demographics.calculated_status = 'Alive'

0 commit comments

Comments
 (0)