Sabtu, 31 Januari 2015

[MS_AccessPros] Patient encounters

 

Patty-


You should start a new thread for a new problem.

What is the SQL of the other query?  What are the fields in the hospital encounters table?  If there is a unique ID for PatientID, then you could do something like:

SELECT PatientID
FROM Hospital_Encounters
GROUP BY PatientID
HAVING Count(*) > 3;

If you want patient details, perhaps something like:

SELECT Patients.PatientID, Patients.LastName, Patients.FirstName, 
   Hospital_Encounters.TreatDate
FROM Patients INNER JOIN Hospital_Encounters
ON Patients.PatientID = Hospital_Encounters.PatientID
WHERE PatientID IN 
  (SELECT PatientID FROM Hospital_Encounters
   GROUP BY PatientID HAVING Count(*) > 3);


John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Jan 31, 2015, at 5:28 PM, pattykf@cox.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

THANK YOU!!!!!
there was a space that caused the error, it now works
YOU ALL ARE WONDERFUL, thank you so much!!

are you up for another challenge?
I have a query where i would like it to tell me who has had 3  hospital encounters,
the table is only hospital encounters, it would have a unique number for each patient, I am guessing that there is a way to show those with 3 or more with some type of formula, just not sure what that would be
Ideas?


__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (24)

.

__,_._,___

Tidak ada komentar:

Posting Komentar