Multiple Records - Show Where All Related Are Complete (1 Viewer)

razorking

Registered User.
Local time
Yesterday, 22:12
Joined
Aug 27, 2004
Messages
332
Having a hard time putting a title on this one. This is odd. I seem to never have come across this before. Also possible that I am going senile and missing something obvious. Trying to figure out how to do this in a query. Example below.
Let's say I have a table that looks something like this:
Order.........Item.........Received
123...............A....................Y
123...............B....................Y
123...............C....................N
223...............A....................Y
223...............B....................Y
223...............C....................Y

And in the example above, let's say there are many more records, orders/items/received indicator.
In a query - what is the best way to show all order numbers that are received, completely and all orders that are not completely received?

I can do it but, not liking the hoops I jumping through. Seems like there ought be a simple way to query for this.

Thanks!
 

plog

Banishment Pending
Local time
Today, 00:12
Joined
May 11, 2011
Messages
11,638
If Received is truly "Y" or "N" and not Yes/No, then an aggregate query that gets the minimum value of Received for an Order would do it:

Code:
SELECT [Order], MIN(Received) AS AllReceived
FROM YourTableNameHere
GROUP BY [Order]
 

razorking

Registered User.
Local time
Yesterday, 22:12
Joined
Aug 27, 2004
Messages
332
If Received is truly "Y" or "N" and not Yes/No, then an aggregate query that gets the minimum value of Received for an Order would do it:

Code:
SELECT [Order], MIN(Received) AS AllReceived
FROM YourTableNameHere
GROUP BY [Order]
That looks like it does the trick. Thanks, appreciate it.
 

Users who are viewing this thread

Top Bottom