Declare @dateDate as DateTime Set @dateDate = SYSDATETIME() select distinct a.PatientName, a.PatientSSN, CONVERT(Date, @dateDate) AS FIRSTVISIT from SPatient.SPatient as a JOIN OUTPAT.VISIT AS D ON A.PATIENTSID=D.PATIENTSID join Dim.Location as c on D.LocationSID=c.LocationSID where c.locationname like '%wi-%' and c.LocationName not like '%wi-PHONE%' and c.LocationName not like '%non va%' and c.LocationName not like '%ds%' group by a.patientname, a.patientssn order by a.patientname, a.patientssn
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)