Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing two fields - one s/b the same, one s/b different

Status
Not open for further replies.

laina222

Technical User
Sep 7, 2001
172
US
Hello all,

I have four fields I'm working with - ID, Sequence, Name, Date. I'm trying to pull any IDs with the same Date but different names. For example, I would want:

ID Sequence Name Date
1 1 Bob 7/10/2004
1 2 Dave 7/10/2004

I would not want:
ID Sequence Name Date
1 1 Bob 7/10/2004
1 2 Bob 7/10/2004

So the ID# should be identical, the sequence should go...sequentially...the date should be the same for each ID, but the name should change from sequence to sequence. There may be an occasion where sequence 1 and sequence 3's names match, but as long as it changes from one sequence to another, it doersn't matter.

Thanks for any help in advance!

Laina
 
I think that the normal way to solve this would be with an alias table.

You could then construct a query joining the two tables where the id, date and sequence are identical, and the names differ.

Note that you would expect to get each pair duplicated unless you select only where name1 is less than name2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top