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!

Linking two SQL tables

Status
Not open for further replies.

ncopeland

IS-IT--Management
Mar 12, 2002
88
GB
I am having a small problem. I want to link two tables. Unfortunately the two SQL tables do not have the same key.

In one of the tables there is a code field which is made up of a two character warehouse field and the product code.

In the other table these fields are seperate. I want to be able to join the fields together in this table and link them to the code in the other table.

I was wondering if anybody had done this. I have had a look at subreports for linking this but have struggled. Any help greatly appreciated.

Kind Regards

Neil Copeland.
 
The only time I've done this in the past I've created a "View" in Toad of the table with the information in two seperate fields, then having created the view by hard coding the SQL I've then joined the view to the 1st table in crystal reports. Cheers

Marc
 
Hi

Suggest you use a subreport. Main report looks at the tables where there is a code field which is made up of a two character warehouse field and the product code.

Subreport looks at the other table.

Create a formula which trims out the warehouse code from your field. Then link the main report to the subreport using the formula and the field for the separate Warehouse code.

If you want to add totals together you will need to then create global variables and add them in the main report.

Hope this helps

Ian Waterman
UK Based Crystal Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top