Unique records

D

Dan J

The following information indicates data stored within one table of a
large database. I am trying to isolate items issued only to a single
account code (110.0800). As an example from the following table, Item
number 0001 and 0003 have only been issued to 110.0800. Item 0002 has been
issued to another account code and I would like to exclude this item from
the information.

As a note of further explanation, the items that are issued to 110.0800
are obsolete and need to be removed; however, if they have been issued to
another area (Account Code), they need to be kept. Any information is
sincerely appreciated.


Issue_No Item_No AccountCode
1 0001 110.0800
2 0001 110.0800
3 0002 115
4 0002 110.0800
5 0003 110.0800
6 0003 110.0800
 
J

John Spencer

Identify the codes that are used in a query. Then use that in another query to
identify just the ones that are used by 110.0800

Method 1
Save the query below as QryUsed
SELECT Issue_No
FROM YourTable
WHERE Issue_No <> "110.0800"

In a new query, you can do the following.
SELECT A.*
FROM YourTable As A LEFT JOIN QryUsed as Q
ON A.Issue_No = Q.Issue_No
WHERE Q.Issue_No is Null

If you are using the query grid, build the first query and save it.
Now use the Unmatched Query Wizard to build the second query.

Once you have the select query working you should be able to change it into a
Delete query
 

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