Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Need help please

Author  Topic 

Ramin
Starting Member

26 Posts

Posted - 2013-07-22 : 14:41:26
HI,

I am trying to run a query to give me the 3 consecutive visit by a patient with 3 doctor for 2012 and 2013 but dont know how? please help. here is my query:


select distinct p.last_name, p.first_name, p.middle_name
, date_of_birth
, [description] as 'Provider Name'
--, person_nbr
, rendering_provider_id
, pe.person_id
, pt.med_rec_nbr
from patient_encounter pe
inner join provider_mstr pm on pm.provider_id = pe.rendering_provider_id
inner join person p on p.person_id = pe.person_id
inner join patient pt on pt.person_id = p.person_id
where rendering_provider_id in ('4BA41C5A-4096-4AAD-BF83-DF620A065B8F', '675EC766-E8E0-48CD-A532-6056ECE52C4C', 'AE9EA089-6A01-4003-9FA9-E1A613666480')
and pe.enc_timestamp BETWEEN '01/01/2012' and GETDATE()
order by 1

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2013-07-22 : 15:18:23
Duplicate post http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=187013



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

Ramin
Starting Member

26 Posts

Posted - 2013-07-22 : 15:19:56
Sorry I am new with this site!.
:)
Go to Top of Page

vidyasagr
Starting Member

2 Posts

Posted - 2013-08-21 : 10:48:53
Hi this is Vidyasagar, could you please do clarify me about DAC, this DAC is always Enable or only need when connect to sql server. Reply me soon.

sagarvidya
Go to Top of Page
   

- Advertisement -