Comparing data from the same table

N

Nick

How can you compare data from the same table.
I have one Id Number and many action codes for the ID
Number. What I am looking for is the Id Number which has
a action code of "07" with no other action codes aquired.
Example
Id Number 123456: action code 07
Id number 123456: action code 01
Id number 654321: action code 07
Id number 789123: action code 07
Id number 789123: action code 02

The only Id number I want to see is 654321
Where and what do I do to see this data?
 
S

Steve Schapel

Nick,

You can do this in a query. Make a query based on the table as you have
described. In the Criteria of the Action Code column, enter "07". In
the Criteria of the Id Number column, put...
Not In(SELECT [IdNumber] FROM YourTable WHERE [action code]<>"07")
 
N

Nick

Thanks,
-----Original Message-----
Nick,

You can do this in a query. Make a query based on the table as you have
described. In the Criteria of the Action Code column, enter "07". In
the Criteria of the Id Number column, put...
Not In(SELECT [IdNumber] FROM YourTable WHERE [action
code] said:
--
Steve Schapel, Microsoft Access MVP

How can you compare data from the same table.
I have one Id Number and many action codes for the ID
Number. What I am looking for is the Id Number which has
a action code of "07" with no other action codes aquired.
Example
Id Number 123456: action code 07
Id number 123456: action code 01
Id number 654321: action code 07
Id number 789123: action code 07
Id number 789123: action code 02

The only Id number I want to see is 654321
Where and what do I do to see this data?
.
 

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