Closed nataliesus closed 2 months ago
Okay, I'm limiting the join to hmis_Exit so we only see ExitDates <= ReportEnd and including HMISEnd* > ReportEnd as a satisfactory condition.
*I hope that's a clear-enough alias -- typing the longer one drives me nuts.
Hi @MollyMcEvilley ,
It looks like the updated restriction by HMISParticipationStatusEndDate should be updated:
I am thinking of the case when project stay is active on the ReportEnd (
x.ExitDate > rpt.ReportEnd
). I.e.Using
part.HMISParticipationStatusEndDate >= coalesce(x.ExitDate, rpt.ReportEnd)
the project stay is rejected because HMISParticipationStatusEndDate < ExitDate but for this case I think it should be accepted.Maybe we can replace
part.HMISParticipationStatusEndDate >= coalesce(x.ExitDate, rpt.ReportEnd)
withpart.HMISParticipationStatusEndDate >= IF( x.ExitDate < rpt.ReportEnd, x.ExitDate, rpt.ReportEnd )
What do you think?
Best regards! Natalie