Re: Help with counting please
- From: Sue <Sue@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 7 Jun 2007 16:57:01 -0700
Hi John, and thanks for your time.
What I'm trying to track here is the diagnosis (and disease stage) of each
patient at the time of their initial visit to our program. Thus each patient
may have only one diagnosis & disease stage. So the structure is:
tblDisease
DiseaseID (autonumber)
Disease (text)
tblDiseaseStatus
DiseaseStatusID (autonumber)
DiseaseStatus
In tblPatients, DiseaseID is a number field, and in the form I use for data
entry (and the query based on tblPatients) there is a combo box which relates
back to tblDisease so, for example, Acute Myeloid Leukemia can be chosen.
Similarly in tblPatients, DiseaseStatusID is a number field, and in the form
I use for data entry (and in the query based on tblPatients) there is a combo
box which relates back to tblDiseaseStatus so that, for example, Relapsed or
No Prior Treatment can be selected.
I hope that makes it more clear.
What I want is to be able to tally the number of patients with each disease
by disease status, ie. the number of non-Hodgkins lymphoma patients who have
relapsed disease, the number of multiple myeloma patients who have had no
prior therapy, etc.
Your help will be greatly appreciated!
--
Thanks for your time!
"John W. Vinson" wrote:
On Thu, 7 Jun 2007 04:17:00 -0700, Sue <Sue@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:.
tblPatient contains the following fields:
DiagnosisID (foreign key from tblDiagnosis)
DiseaseStatusID (foreign key from tblDiseaseStatus)
ScreenStatusID (foreign key from tblScreenStatus)
Um????
This appears to be incorrectly set up. Surely each Patient may have many
Diagnoses, and each Diagnosis can apply to many Patients... a many to many
relationship. What's in tblDiagnosis? Is this a list of all the valid
diagnosis codes and condition names?
Similarly for the other tables... what is the actual structure of your tables?
The foreign key should - MUST - be in the "many" side table. If you have a
DiagnosisID field in the Patient table then you're saying that the patient can
have either zero or one conditions, never more. That would be nice, but I
would need four DiagnosisID's myself, right now!
John W. Vinson [MVP]
- Follow-Ups:
- Re: Help with counting please
- From: John W . Vinson
- Re: Help with counting please
- References:
- Re: Help with counting please
- From: John W . Vinson
- Re: Help with counting please
- Prev by Date: Re: complicated query
- Next by Date: Re: Query to check a field and select fields from a table
- Previous by thread: Re: Help with counting please
- Next by thread: Re: Help with counting please
- Index(es):
Relevant Pages
|