J
john.mctigue
I am using Access 2003 SP3
I have two tables, haema_Patient with PK 'ID' joined 1:many to
haema_Diagnosis with PK 'DiagID' and FK 'ID'. haema_Diagnosis also
records the hospital at which a diagnosis was made.
haema_Patient
----------
PatientID (PK)
haema_Diagnosis
------------
DiagID (PK)
PatientID (FK)
HospitalID
A patient may have one or more diagnoses, each diagnosis occurring at
a particular hospital. A patient with more than one diagnosis may
have had those diagnoses made, in aggregate, at one or more hospitals.
I would like a query that will give a count of unique patient IDs, and
of all diagnoses associated with those patient IDs, for each hospital
such as:
Hospital Count of unique PatientID Count of DiagID
-------- ------------------------- ----------------------
A 12 13
B 4 4
C 23 25
I would also like a query to do summary counts across all hospitals,
such as (using the same columns as above):
[ALL] 37* 42
*NB: Not 39 - two patients each had two diagnoses, each at separate
hospitals.
Any help would be greatly appreciated.
John McTigue
I have two tables, haema_Patient with PK 'ID' joined 1:many to
haema_Diagnosis with PK 'DiagID' and FK 'ID'. haema_Diagnosis also
records the hospital at which a diagnosis was made.
haema_Patient
----------
PatientID (PK)
haema_Diagnosis
------------
DiagID (PK)
PatientID (FK)
HospitalID
A patient may have one or more diagnoses, each diagnosis occurring at
a particular hospital. A patient with more than one diagnosis may
have had those diagnoses made, in aggregate, at one or more hospitals.
I would like a query that will give a count of unique patient IDs, and
of all diagnoses associated with those patient IDs, for each hospital
such as:
Hospital Count of unique PatientID Count of DiagID
-------- ------------------------- ----------------------
A 12 13
B 4 4
C 23 25
I would also like a query to do summary counts across all hospitals,
such as (using the same columns as above):
[ALL] 37* 42
*NB: Not 39 - two patients each had two diagnoses, each at separate
hospitals.
Any help would be greatly appreciated.
John McTigue