cancel
Showing results for 
Search instead for 
Did you mean: 

How to combine rows from different unrelated tables?

Former Member
0 Kudos

I need to create a report where the data are coming from 2 unrelated tables. My calculation needs data from both tables. Is this possible within Crystal Reports without having to write complicated SQL commands? If not, can someone provide an example of such a query?

thanks in advance

-Mark

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Morning Mark,

Yes Amr is right however there has to be some sort of link between the two tables to create a join. For example a Order no from one table matches with other Order no.

There could be another possibility and that is if you have a third table which has two fields common to those two tables then when you bring the third table it will act as a middle man.

If you need to bring the information onto the report according to some sort of criteria then those two tables need to be linked togeather at some point otherwise it won't work.

For example

I have two tables, FOC and Customer, both have nothing in common however the third table Orders has fields which is common to FOC and Customer. So I linked the two tables via Orders table. Now when I open my report my results are based on the Customer and FOC number.

Hope this helps

Regards

Jehanzeb

Former Member
0 Kudos

Thank you so much for the responses. Linking these unrelated tables via a third common table sounds like the solution to the problem; fortunately for me I have discovered that there is an indeed a third table that has this link and has all the information that I need. Thanks again for the suggestion. I am pretty sure that it will come in handy in the future.

amrsalem1983
Active Contributor
0 Kudos

for sure you can do that, thats why crystal has been created.

you can add those two tables, and link them using some joins based on your business logic.

then you can do the calculations as you want.

good luck

Amr