Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unable to Select Full Outer Join Between Databases

Posted on 2006-11-27
7
Medium Priority
?
288 Views
Last Modified: 2008-02-01
I have a report based upon four views from one database and one view from another database (housed on the same server). I need a full outer join between one view and each of the other 4 views. That isn't a problem with the four views within the same database, but I can't get a full outer join between the main view and the one view that is in another database. I can get the left outer join, but not a full outer join. If I could get the full outer join to work, I think the report would run faster.

View 1 - Full Outer Join View 2 (same database)
View 1 - Full Outer Join View 3 (same database)
View 1 - Full Outer Join View 4 (same database)
View 1 - Left Outer Join View 5 (different database)

I've checked the field types and they match (all varchar) - however, some of the fields are longer in view 5.
Any ideas why this isn't working?

Thanks in advance.
0
Comment
Question by:Carla Romere
7 Comments
 
LVL 26

Accepted Solution

by:
Kurt Reinhardt earned 2000 total points
ID: 18022052
This is a limitation of Crystal Reports.  When you connect multiple databases--even when they are housed on the same server--you are limited in what you can do.  My recommendation is for you to create a View on one database that does everything you need within SQL.  You can then use this single View as your datasource for the report.

~Kurt
0
 
LVL 13

Expert Comment

by:crgary_tx
ID: 18022304
Can Business Views be used? I think by definition Business views integrate different datasources.

Thanks,
Gary
0
 

Author Comment

by:Carla Romere
ID: 18022346
Okay - I'm showing my ignorance here - I don't know what Business Views is...

Each view is pulling such very specific information and I don't know how I'd limit that from within CR.

For instance: 3 of the views are actually based on the same table on the sql-server but are each limiting the information they pull. Here is a brief example:

View #1 pulls all current inventory from Table 1
View #2 pulls only the product SOLD within the last week from Table #2
View #3 pulls only the product we ran in the last week from Table #2
View #4 pulls only the product we received in the last week from Table #2
View #5 pulls only the products we expect to receive in the next week from Table #3

The report is based upon location/product/form and each of the views is joined upon that same information.
The customer wants to see each location and for that location to see what amounts to a crosstab report showing 5 different numbers for each location/product/form combination. Material received, current inventory, material sold, material ran, and material expected.

                                         Table #2            Table #1        Table #2        Table #2           Table #3
Location A                          Received             Current             Sold               Ran               Expected          Anticipated (current + expected)
  Product A Form A               42000              1468000               0              126420               120000            1588000
  Product A Form B                   0                   250000            20000          175435                84000              334000

If there is a way to limit each column's data by very specific criteria, I could do the entire report with only 3 views instead of 5.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 101

Expert Comment

by:mlmcc
ID: 18022514
As Kurt pointed out you will need to do this in the database as Crystal cannot handle it.

Can you add a linked table to link table 3 into the other database?

The other way to do this is to uswe a subreport to provide the data from table 5.

mlmcc
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 18023808
Business Views are a semantic data layer you create between the User and the Database.  If you're using Crystal Reports 10/Crystal Enterprise 10 or crystal Reports XI/BusinessObjects Enteprise XI then you can create Business Views.  I opine, however, that this would add an unnecessary layer of configuration and maintenance to your report.  A simple database view would be the easiest way to go.

~Kurt
0
 
LVL 17

Expert Comment

by:MIKE
ID: 18024095
Can you DTS the data in...based on a SQL Script..so that ALL data is on the same server?
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 18025331
Why would you DTS data in if you can simply create a view that joins the data from both servers in a single place?  By doing so, you'd now have data in two places and would have to maintain it via automated DTS packages.  It would also mean that the data isn't 'live', which would be fine in a true data warehouse environment.

A simple view would look like this:



~Kurt
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question