Query question

P

Pj

I have a question that I hope you all can help me with. When I run a query,
the results come back with multiple lines of data for an order because of
multiple critereas in another field. Here is an example of the data returned
to my query:

Order Status
A In Process
A Sent
B In Process
C In Process

I would like to see only the data for orders that have not been shipped, and
totally exclude data for orders that have been sent. In the example above, I
would like my query results to show Orders B and C, but no data for A since
it has already been Sent. I am relatively new to Access and have no idea how
to create a formula for this.

Thanks for your help and I hope this makes sense
 
D

Douglas J. Steele

You're best off creating a subquery of all of those that have been sent, and
exclude those orders in the main query:

SELECT Order, Status
FROM MyTable
WHERE Order NOT IN (SELECT Order
FROM MyTable
WHERE Status = "Sent")
 
R

rozane

Pj said:
I have a question that I hope you all can help me with. When I run a
query,
the results come back with multiple lines of data for an order because of
multiple critereas in another field. Here is an example of the data
returned
to my query:

Order Status
A In Process
A Sent
B In Process
C In Process

I would like to see only the data for orders that have not been shipped,
and
totally exclude data for orders that have been sent. In the example above,
I
would like my query results to show Orders B and C, but no data for A
since
it has already been Sent. I am relatively new to Access and have no idea
how
to create a formula for this.

Thanks for your help and I hope this makes sense
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top