Incorrect results from Query

Muffinshuttleworth

New member
Local time
Today, 14:38
Joined
Aug 13, 2009
Messages
5
I have a master table which contains all our clients' details. I am running a query to pull out specific health problems from the field named healthnotes. In this field are ALL medical and health issues pertaining to the client e.g. depression, osteoartritis, suffered stroke etc etc. I can run the query fine but it i only pulling out those clients which ailment is at the beginning of the field. E.G. Mrs Smith has depression, diabetes and had a heart attack. If I run the query to pull out clients with diabetes, Mrs Smith would not appear as 'diabetes' is the second entry in ther healthnotes field. She would however appear in the clients with depression query as that's first entry in the field. I have tried wildcards, and letter specific criteria and nothing seems to pull out any value further along the field. HELP PLEASE!!!
 
Your database is not well structured.

Client details should only carry name and details etc recorded against a PatientID primary key. This is the only place where the patient name is recorded. Everywhere else the patient is referred to by their ID.

The HealthNotes should be a separate table with field for PatientID and health issue. Each issue should be a separate record against the PatientID.

Also HealthIssue should be another table with HealthIssueID and IssueName. The HealthNotes table should record the issue as the ID rather than the name. The HealthIssue table is the only place in the database where the name is recorded. Everywhere else the issue will be referred to by the ID.

Searching for the patients with a particular issue is done by searching for records in the HealthNotes table by HealthIssueID.
 
The title of this thread suggest that the query is returning an incorrect result. In fact what it is doing is returning a result you do not expect due to either;
  1. An error in your logic
  2. An error cause by the structure of your tables; or
  3. An error in the construction of your query
 

Users who are viewing this thread

Back
Top Bottom