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

Need to add 2 fields from 2 unrelated tables

Status
Not open for further replies.

cheerfulskeptic

Programmer
Feb 3, 2003
88
IN
I have a report and I need to pull data from two unrelated database tables... Call them EU_Part_Lot and Part_Lot. I need to add the field A from EU_Part_Lot to field A from Part_Lot. These two tables have no data fields in common. In the visual linking there are no links. I get the message saying "this is not commonly supported" etc etc when i click OK in the visual Linking Expert.
How do I get these two to add?
Thanks!
 
I think you could do this by using one table in the main report and then adding an unlinked subreport with the other table. Then create a shared variable within the subreport, place the subreport above the section where you plan to add the calculation, and refer to the shared variable in a formula within the main report which adds it to your main report table value.

The question is whether you will end up with meaningful data if there is no relationship between the two tables. When I tried this, with two tables with no links, where the second table had only two values, it appeared to add the last value to all instances of the table value in the main report, since the subreport was placed above the section with the calculated field. If I sorted the subreport field the opposite way (descending), the other value was added to all values in the main report. Which is only to say that you have to be clear about your logic when you do this...

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top