Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2003, 08:41 AM
gbshahaq gbshahaq is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: london, uk
Posts: 2 gbshahaq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Access 97 - sorting numbers

i have a table listing customer names and addresses, along with unique customer id numbers.

I have a simple query to identify the duplicates, and this lists customer names and customer numbers.

What I now want is a table with 2 columns of customer numbers - one for the original (lowest) customer number, and one for the duplicate. Any easy way to do this? all ideas welcome!

thanks 4 reading...

Reply With Quote
  #2  
Old December 9th, 2003, 03:43 AM
gbshahaq gbshahaq is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: london, uk
Posts: 2 gbshahaq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
got a fix from a friend in the meantime:
SELECT Dupstha2_1.FNAME, Dupstha2_1.LNAME, Dupstha2_1.[Cust No], Dupstha2_2.[Cust No]
FROM Dupstha2 AS Dupstha2_1, Dupstha2 AS Dupstha2_2
WHERE Dupstha2_1.[Cust No] < [Dupstha2_2].[Cust No]
AND Dupstha2_1.FirstNAME = Dupstha2_2.FirstNAME
AND Dupstha2_1.LastNAME = Dupstha2_2.LastNAME
AND Dupstha2_1.STREET = Dupstha2_2.STREET;

Basically what is does is that it joins the Dupstha2 table with itself on the FNAME column and the STREET column. The Dupstha2_1.[Cust No] < [Dupstha2_2].[Cust No] makes sure that the two [Cust No] combinations is only shown once.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Access 97 - sorting numbers


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway