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
|
|||
|
|||
Return records only when all linked records meet criteria
I am trying to write a query that returns all records only when all [Result]
values are 12.0 ? For example, the query below returns the following sample data: SELECT tbl_trans.TransNo, tbl_lab.LabNo, tbl_lab.Result FROM tbl_trans LEFT JOIN tbl_lab ON tbl_trans.Account = tbl_lab.Account WHERE (((tbl_trans.LabMet)"Y") AND ((tbl_trans.PtType) Not Like "O")) ORDER BY tbl_trans.TransNo TransNo LabNo Result 3 4610 9.7 3 1098 9.6 3 1047 8.7 3 875 5.6 5 1303 12.1 5 1214 12.4 5 1094 12.5 8 2176 11.6 8 1415 11.9 8 871 9.6 How do I mofiy the query to return all [TranNo] 5 records only: TransNo LabNo Result 5 1303 12.1 5 1214 12.4 5 1094 12.5 thanks! |
Thread Tools | |
Display Modes | |
|
|