Query with certain criteria

M

Mike

I have the following information:

I have a table with the following fields: store #, date, transaction #,and
line #(whether it was paid, taxes involved, markdowns). There are repeated
transaction #'s becaue of the different line #'s. For example:

Store # Transaction # Date Line #
060159 542596 09/02/09 MRD
060159 542596 09/02/09 TXS

I wanted to be able to create a query saying that if the store #/transaction
# does not have a line # of MRD, bring back only that information.

Thanks in advance.
Mike
 
D

Douglas J. Steele

SELECT StoreNumber, TransactionNumber, TransactionDate, LineNumber
FROM MyTable
WHERE StoreNumber NOT IN
(SELECT DISTINCT StoreNumber
FROM MyTable
WHERE LineNumber = "MRD")
 

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