changed the subject but kept the old message to have hx.
yes there is a unique ID for the patient so I will look at doing this. I really appreciate your help. You are a great resource, I will give it a shot on Monday, and let you know how it goes.
thankx
Patty
Director of Quality
WellOne Primary Medical and Dental Care
Rhode Island, USA
---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :
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@... [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: pattykf@cox.net
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (25) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar