If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Query crosses 3 tables
I have 3 tables. tblPatient contains ID, Name, Age....., tblAdmission
contains ID, PatientID, AdmissionDate....., tblCertificate contains ID, PatientID, AdmissionDate..... How to combine the following 2 queries into one that crosses 3 tables? (Please note that the WHERE clause in the second query has error by itself). Thank you. SELECT tblPatient.*, tblCertificate.* FROM tblPatient INNER JOIN tblCertificate ON tblPatient.ID = tblCertificate.PatientID WHERE tblCertificate.ID = Me!txtID SELECT tblPatient.*, tblAdmission.* FROM tblPatient INNER JOIN tblAdmission ON tblPatient.ID = tblAdmission.PatientID WHERE tblAdmission.AdmissionDate = tblCertificate.Admission -- Jeff |
Thread Tools | |
Display Modes | |
|
|