Skip to content

Commit 0bbe714

Browse files
committed
updated query
1 parent d8a5b5f commit 0bbe714

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

onprc_ehr/resources/queries/study/Demographics_NotInMMA.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ WHERE d.Id.curlocation.area NOT IN ('Shelters', 'Corral', 'Hospital', 'Catch Are
3434
AND NOT EXISTS (
3535
-- -- Find animals whose latest 'Weight MMA BEGIN' has no later 'Weight MMA RELEASE'
3636
SELECT 1
37-
FROM study.WeightManagementMMAData b
37+
FROM study.WeightMMA b
3838
WHERE b.Id = d.Id
3939
AND b.code = 'P-YY961'
4040
AND b.date = (
4141
SELECT MAX(b2.date)
42-
FROM study.WeightManagementMMAData b2
42+
FROM study.WeightMMA b2
4343
WHERE b2.Id = d.Id
4444
AND b2.code = 'P-YY961'
4545
)
4646
AND NOT EXISTS (
4747
SELECT 1
48-
FROM study.WeightManagementMMAData r
48+
FROM study.WeightMMA r
4949
WHERE r.Id = d.Id
5050
AND r.code = 'P-YY960'
5151
AND r.date > b.date

0 commit comments

Comments
 (0)