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 TABLES FROM MULTIPLE COMPANIES

Status
Not open for further replies.

shoedog

Technical User
Jun 9, 2005
8
US
I'm using Crystal Reports version II. I would like to know if I can link from different databases the same table to obtain my data. For ex. Company A and Company B each has a different ODBC name. however table IV00101.dat is included on both companies. I would like to take the information of both companies' tables into one report.
Thanks,
jayne

 
I need to clarify that the version is CR XI. Thanks for your help,Jayne
 
Hi,
Have you tried linking them?

What was the result?

( As one of the regulars on Tek-Tips has stated:
"One test is worth a thousand theories" )



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I can get the data frome one Company with the following script: SELECT RM20101.CUSTNMBR, RM00101.CUSTCLAS, RM20101.DOCNUMBR, RM20101.DOCDATE, RM20101.CURTRXAM, RM20101.ORTRXAMT, RM20101.CSPORNBR
FROM DIBAI.dbo.RM00101 RM00101 LEFT OUTER JOIN DIBAI.dbo.RM20101 RM20101 ON RM00101.CUSTNMBR=RM20101.CUSTNMBR
WHERE RM00101.CUSTCLAS='FIRST COST' AND RM20101.CURTRXAM>0
ORDER BY RM20101.CUSTNMBR

I don't know if I should use 'union all' to include the 2 other databases or link the tables, but which key field to use. I would like the results to be grouped by Company since the companies may have the same customers listed. Thanks,Jayne
 
I would try the union all. You can add a field in each segment of the union all that identifies the company. Not sure of the syntax for your database. Could be: 'CompanyA' as Company. Then you could group on {command.company}--assuming that each database represents a specific company.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top