A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Return records only when all linked records meet criteria



 
 
Thread Tools Display Modes
  #1  
Old December 2nd, 2009, 08:10 PM posted to microsoft.public.access.queries
yator
external usenet poster
 
Posts: 36
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.