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

Join two tables to pull specific field into the report

Status
Not open for further replies.

tdrBates

MIS
Nov 22, 2002
60
0
0
US
I need to be able to join "Table_1.TRIPID" and "Table_1.SEQUENCE' to "Table_2.TRIPID" and "Table_2.SEQUENCE'
to pull "Table_1.schHwy"

Table_1

"schHwy","TRIPID","SEQUENCE"
0,"1834556",24
0,"1834556",3
0,"1834556",4
0,"1834556",5
0,"1834556",6
0,"1834556",7
0,"1834556",8
0,"1834556",9
0,"1834847",1
0,"1834847",10
0,"1834847",11
0,"1834847",12
0,"1834847",13
0,"1834847",14

Table_2

"SEQUENCE","TRIPID"
1,"1743206"
1,"1743207"
1,"1743208"
1,"1743228"
1,"1743229"
1,"1743230"
1,"1743232"
1,"1743220"
1,"1743233"
1,"1743234"
1,"1743235"
1,"1743211"
1,"1743210"
1,"1743212"
1,"1743248"
1,"1743213"
1,"1743215"
1,"1743214"
1,"1743219"
1,"1743268"
1,"1743269"
1,"1743216"
1,"1743270"
1,"1743271"
1,"1743272"
1,"1743273"
1,"1743221"
1,"1743222"
1,"1743223"
1,"1743224"
1,"1743226"
1,"1743227"
1,"1743198"
1,"1743236"
1,"1743237"
1,"1743238"
1,"1743239"
1,"1743240"
1,"1743241"
1,"1743242"
1,"1743243"
1,"1743244"
1,"1743245"
1,"1743246"
1,"1743247"
1,"1743250"
1,"1743251"
1,"1743252"
1,"1743253"
1,"1743254"
1,"1743255"
1,"1743256"
1,"1743257"
1,"1743258"
1,"1743217"
1,"1743259"
1,"1743188"
1,"1743218"
1,"1743189"
1,"1743190"
1,"1743209"
1,"1743191"
1,"1743192"
1,"1743193"
1,"1743194"
1,"1743195"
1,"1743196"
1,"1743197"
1,"1743200"
1,"1743201"
1,"1743202"
1,"1743203"
1,"1743204"
1,"1743205"
1,"1743249"
1,"1743199"
2,"1743206"
2,"1743207"
2,"1743208"
2,"1743228"
2,"1743229"
2,"1743230"
2,"1743231"
2,"1743232"
2,"1743220"
2,"1743233"
2,"1743234"
2,"1743235"
2,"1743211"
2,"1743210"
2,"1743212"
2,"1743248
 
Whats your question
Add both tables to report and in Linking expert drag click in Sequence in Table 1 and drag to Sequence Table2
Repeat for ID. This creates a SQL join.
If you require another type of join right click join line and select join type you want.

Ian
 
Thanks Ian! The problem I'm having is that "SEQUENCE" and "TRIPID" are not unique fields in either table.
Is it possible to still join the two tables and get the correct "schHwy"?
 
Table_1 and Table_2 have several other fields that are the same in each table, but I have no fields in both table that are the same and also primary or unique fields.
Is it possible to join tables that have no unique fields?
 
What happens if you join the two tables on both fields? Trip ID and sequence?

-LB
 
I don't know your data.
Do Joins as suggested and see what values for schHwy are returned.

If you get multiple results for same schHwy value then you will probably need to add a filter on one or several other fields.
You can add the filter in the select expert

Ian
 
Thanks, I will do joins as suggested and see what values for schHwy are returned.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top