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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help w/ Trying To Reference Records.

Status
Not open for further replies.

Bigced21

Programmer
Feb 5, 2003
76
US
Ok, what I'm trying to do is reference other records w/ the same Business_name and/or Address to the first existence of the first record w/ that Bus_name or Addy.
 
Can you be more explicit please ?
Something like actual input and desired output.
 
OK, in the original tbl there's a owner & user for each rec. What I'm trying to deal w/ is the dups bus_names &/or Addy's to relate to the firstexistence of a rec by Bus_name or Addy. Check out the data below and you'll get a jist of what I'm talking about. Just so you know the code that I'm looking for is what formed this data to reference like this.

id Imp_id Ref_ID Type Bus_Name Addy
----------------------------------------------------------
1 32151 1 OWNR KENTON CO FISCAL COURT KY 301
32151 32151 32151 USER ROAD DEPARTMENT 4000 GLENN
2 32152 2 OWNR COMMONWEALTH OF KY
32152 32152 32152 USER COMMONWEALTH OF KY STANDIFORD 3 32153 3 OWNR BENHAM SCHOOL HOUSE INN
32153 32153 32153 USER 40807 0000000000
4 32154 4 OWNR LAUREL HEIGHTS HOME 208 WEST
32154 32154 32154 USER 212 W 12TH ST
5 32155 4 OWNR LAUREL HEIGHTS HOME 208 WEST
32155 32155 32154 USER 212 W 12TH ST
 
I'll start from the beginning.
I have a table w/ a columns of id, state_no(which is unique), Owner_name, Owner_add1, User_name, User_addy1.
The data I just showed you is the result of the code that I'm seeking. OK, the tbl had been inserted first w/ the Owner's info and inserted a second time with User's info. So, basically I'm trying to reference all the other dups to the existence of the first record that has the same bus_name or addy1. Here's an example of the table I showed you before except this time its not ordered.
The reference_id is referenced to the ID and the import_id is the ID from the table the data was import from.

ID Import_ID Ref_id type bus_name Add1 etc..
------------------------------------------------------
70 32591 40050 OWNR TURFWAY RACE ASSOCIATION 7500 TURFWAY RD FLORENCE KY 41042
71 32593 71 OWNR ST ANDREWS EPISCOPAL CHURCH 3 CHALFONTE PLACE FT THOMAS KY 41075
72 32214 34 OWNR HOUSING AUTH OF LOUISVILLE 420 S 8TH ST LOUISVILLE KY 40203
73 32215 34 OWNR HOUSING AUTH OF LOUISVILLE 420 S 8TH ST LOUISVILLE KY 40203
74 32216 34 OWNR HOUSING AUTH OF LOUISVILLE 420 S 8TH ST LOUISVILLE KY 40203
75 32217 34 OWNR HOUSING AUTH OF LOUISVILLE 420 S 8TH ST LOUISVILLE KY 40203
76 32218 34 OWNR HOUSING AUTH OF LOUISVILLE 420 S 8TH ST LOUISVILLE KY 40203
77 32219 34 OWNR HOUSING AUTH OF LOUISVILLE 420 S 8TH ST LOUISVILLE KY 40203
78 32220 34 OWNR HOUSING AUTH OF LOUISVILLE 420 S 8TH ST LOUISVILLE KY 40203
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top