I’ve pasted it below. I bolded the applicable part in the where statement.
Thanks, Melissa
SELECT
( PersonMatchDetail_LN.TargetValue ) + ':' + ( PersonMatchDetail_FN.TargetValue ) + ':' + ( PersonMatch.HNEId ),
PersonMatch.HNEId,
PersonMatch.PersonMatchId,
PersonMatch.TotalScore,
PersonMatch.SufficientScore,
PersonMatch.CreateDate,
PersonMatch.Action,
PersonMatchDetail_LN.CandidateValue,
PersonMatchDetail_FN.CandidateValue,
ISNULL(PersonMatchDetail_MN.CandidateValue,' '),
PersonMatchDetail_Sex.CandidateValue,
( PersonMatchDetail_BM.CandidateValue ) + '/' + ( PersonMatchDetail_BD.CandidateValue ) + '/' + ( PersonMatchDetail_BY.CandidateValue ),
PersonMatchDetail_SSN.CandidateValue,
PersonMatch.MatchHNEId,
PersonMatchDetail_MRN.CandidateValue,
PersonMatchDetail_MRN.CandidateSuppValue,
( PersonMatchDetail_BM.TargetValue ) + '/' + ( PersonMatchDetail_BD.TargetValue ) + '/' + ( PersonMatchDetail_BY.TargetValue ),
PersonMatchDetail_FN.TargetValue,
PersonMatchDetail_LN.TargetValue,
ISNULL(PersonMatchDetail_MN.TargetValue,' '),
PersonMatchDetail_MRN.TargetSuppValue,
PersonMatchDetail_SSN.TargetValue,
PersonMatchDetail_Sex.TargetValue,
PersonMatchDetail_MRN.TargetValue
FROM
PersonMatchDetail PersonMatchDetail_LN,
PersonMatchDetail PersonMatchDetail_FN,
PersonMatch,
PersonMatchDetail PersonMatchDetail_MN,
PersonMatchDetail PersonMatchDetail_Sex,
PersonMatchDetail PersonMatchDetail_BM,
PersonMatchDetail PersonMatchDetail_BD,
PersonMatchDetail PersonMatchDetail_BY,
PersonMatchDetail PersonMatchDetail_SSN,
PersonMatchDetail PersonMatchDetail_MRN
WHERE
( PersonMatchDetail_BM.PersonMatchId=*PersonMatch.PersonMatchId )
AND ( PersonMatch.PersonMatchId*=PersonMatchDetail_MRN.PersonMatchId )
AND ( PersonMatch.PersonMatchId*=PersonMatchDetail_LN.PersonMatchId )
AND ( PersonMatch.PersonMatchId*=PersonMatchDetail_BD.PersonMatchId )
AND ( PersonMatch.PersonMatchId*=PersonMatchDetail_Sex.PersonMatchId )
AND ( PersonMatch.PersonMatchId*=PersonMatchDetail_SSN.PersonMatchId )
AND ( PersonMatch.PersonMatchId*=PersonMatchDetail_BY.PersonMatchId )
AND ( PersonMatchDetail_MN.PersonMatchId=*PersonMatch.PersonMatchId )
AND ( PersonMatchDetail_FN.PersonMatchId=*PersonMatch.PersonMatchId )
AND ( PersonMatchDetail_BD.ComponentName= 'birth day' )
AND ( PersonMatchDetail_BM.ComponentName= 'birth month' )
AND ( PersonMatchDetail_BY.ComponentName= 'birth year' )
AND ( PersonMatchDetail_FN.ComponentName= 'first name' )
AND ( PersonMatchDetail_LN.ComponentName= 'last name' )
AND ( PersonMatchDetail_MN.ComponentName= 'middle name' )
AND ( PersonMatchDetail_MRN.ComponentName= 'mrn' )
AND ( PersonMatchDetail_Sex.ComponentName= 'sex' )
AND ( PersonMatchDetail_SSN.ComponentName= 'ssn' )
AND ( PersonMatch.CreateDate >= @Prompt('Beginning Date for Report','D',{'01/01/1900 12:00:00 AM'},MONO,FREE)
AND
PersonMatch.CreateDate <= @Prompt('Ending Date for Report','D',{'12/31/2100 11:59:59 PM'},MONO,FREE) )
AND ( PersonMatch.Action != 'Exact Match'
AND PersonMatch.Verified = 0
AND PersonMatch.Action IN @Prompt('Include Associate and/or Report Matches','A',{'Associate', 'Report'},Multi,Constrained) )
[b]AND ( ( PersonMatchDetail_MRN.TargetSuppValue ) IN @Prompt('Enter MRN Assigning Authority','A','Association Report\Assigning Authority Name - Select',Multi,free) or 'ALL' IN @Prompt('Enter MRN Assigning Authority','A','Association Report\Assigning Authority Name - Select',Multi,free) )[/b]ORDER BY
1,
14,
3
Melissa Piccolo (BOB member since 2002-08-16)