Solved

Unable to Select Full Outer Join Between Databases

Posted on 2006-11-27
7
282 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:Hers2keep
7 Comments
 
LVL 26

Accepted Solution

by:
Kurt Reinhardt earned 500 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:Hers2keep
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

947 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now