Query Help

Charlie

Board Regular
Joined
Mar 1, 2002
Messages
134
I am trying to produce a query that will produce all the selected treatment records for one patient only in my test database.
I am trying to edit an Access produced query to do this job for me, the query as it stands produces a list of all the patients who have received treatment and by who etc. as I explained before I only want one particular record. This is my query in SQL:

SELECT tblTreatment.TreatmentHistoryID, tblNurses.NurseID, tblNurses.Title AS tblNurses_Title, tblNurses.NFirst_Name, tblNurses.NSurname, tblDoctors.DoctorID, tblDoctors.Title AS tblDoctors_Title, tblDoctors.First_Name, tblDoctors.Surname
FROM tblTreatment INNER JOIN (tblDoctors INNER JOIN (tblNurses INNER JOIN tblInPatients ON tblNurses.NurseID = tblInPatients.NurseID) ON tblDoctors.DoctorID = tblInPatients.DoctorID) ON tblTreatment.TreatmentHistoryID = tblInPatients.TreatmentID;

I have tried adding WHERE [FirstName] = "Jack" but this produces a line of blnk cells.
would someone show me what my problem is.

Thanks
Charlie
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Eliminate the Where expression

In the row below that where it says criteria type: like "jack". And make sure the show option is checked off.

The "Where" expression will get you the information you are requesting but will hide the column.
 
Upvote 0
Thanks

I dont know how to tell you this, I solved it myself a short time ago. The BIG error I made was that I was searching for a non existent criteria, I did not include the patient name in the query merely the patient ID so I should have been looking for the number 1.
Quite simply "I fu**ed up", sorry if I wasted your time. I liked the info about the missing column though, very useful.
Appreciate the effort.
Well played mate.

Charlie
 
Upvote 0

Forum statistics

Threads
1,221,510
Messages
6,160,226
Members
451,632
Latest member
purpleflower26

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top