Joining 2 fields between 2 tables

4162
8
02-09-2015 12:41 PM
MichelleCouden
Occasional Contributor

I need to join 2 tables together using 2 fields. For Example, I need to join 2 tables to beginning milepoint field and ending milepoint field. I thought I could use Add Join in thedata management box but I can't seem to get that to work. Any suggestions?????

0 Kudos
8 Replies
MichelleCouden
Occasional Contributor

One thing to add the one table is a dbf.

0 Kudos
DarrenWiens2
MVP Honored Contributor

Have you read this help page: Joining attributes of one table to another?

Also, is this what you mean by join (adding matching columns onto records based on a matching attribute value)? Sometimes people say "join" and mean something else entirely.

0 Kudos
MichelleCouden
Occasional Contributor

Yeah, that's the add join. I was reading it some more I don't think that will work. Because, I need 2 fields to 2 fields. Let me explain some more. So, in one table I have a field bmp and a field emp. Like such 0.123 and 1.234. Then I have another table with a field bmp and a field emp. Like such 0.123 and 1.234. I need to join the 2 fields on both tables. So, in the end I'll end up with one table with 4 fields that are the same.

0 Kudos
MichelleCouden
Occasional Contributor

I just tried it and it won't allow me to put a second field to use for the join.

0 Kudos
LisaTurner
Occasional Contributor II

I don't know if this would cause too much extra work or not, but it sounds like something that one could do rather quickly in Microsoft Access.

Just curious, do the mile point values repeat themselves on multiple roadways, or do they each have a unique value?

0 Kudos
MichelleCouden
Occasional Contributor

I thought about that but my one layer is a line shapefile. I didn't know if I could move that into an Access.

0 Kudos
LuciHawkins
Occasional Contributor III

If I am understanding you correctly, you probably have duplicate "bmp" entries and you only want them to join "IF" the "bmp" AND the "EMP" are the same as the other table row.  Someone that knows python might be able to get you going in the right direction.  I just don't know python well enough to say it can be done.

My workaround would be to add another field in and field calculate the value to be a combination of the bmp and emp.

ie: BMPandEMP

Do the same for the other table.  I know it adds extra fields, but they would then be unique for joining purposes.

Food for thought.

Thanks,

Luci

MichelleCouden
Occasional Contributor

That's a nice work around. I'll try that. I'll try my spatial join idea first. Yeah, I was thinking it was going to take Python.

0 Kudos