SELECT a.PatientAccountID ,b.OrderSubTypeAbbr ,b.CreationTime FROM PatientVisit a with( nolock) INNER JOIN Order b with( nolock) ON a.PatientVisit_oid=b.PatientVisit_oid WHERE a. VisitTypeCode ='IP' AND b.OrderSubTypeAbbr IN ('CT Scan','MRI') AND b.CreationTime >=DATEADD(m,-1,GETDATE()) ORDER BY a.PatientAccountID
WHERE a. VisitTypeCode ='IP' AND b.OrderSubTypeAbbr IN ('CT Scan','MRI') -- to filter by month AND month(b.CreationTime) >= @month -- ' get month from design 'parameter'' -- to filter by hour and DATEPART(hour,b.CreationTime) = @hour -- get it from design 'parameter' ORDER BY a.PatientAccountID
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)