SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Need help please
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ramin
Starting Member

26 Posts

Posted - 07/22/2013 :  14:41:26  Show Profile  Reply with Quote
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

Sweden
30114 Posts

Posted - 07/22/2013 :  15:18:23  Show Profile  Visit SwePeso's Homepage  Reply with Quote
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 - 07/22/2013 :  15:19:56  Show Profile  Reply with Quote
Sorry I am new with this site!.
:)
Go to Top of Page

vidyasagr
Starting Member

India
2 Posts

Posted - 08/21/2013 :  10:48:53  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000