Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Data Connectivity
Message Icon Topic: Archive Database Post Reply Post New Topic
Author Message
Chase
Newbie
Newbie


Joined: 28 Jan 2013
Online Status: Offline
Posts: 17
Quote Chase Replybullet Topic: Archive Database
    Posted: 16 Apr 2013 at 4:42am
I have two databases, one current, one archive. Same table, same fields, same everything. I essentially want to pull data from both into the same report as if they are one database. Is there any way I can do this?
IP IP Logged
praveeng
Senior Member
Senior Member
Avatar

Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
Quote praveeng Replybullet Posted: 13 Jun 2013 at 11:51pm
HI Chase,
 
In your situaltion, we can pull data from both databases into the same report.
I have created two excel sheet with same data, same fields in different locations, when i add the two sheets in to report the second sheet name is renamed as Sheet1_2.
I even checked the SQL condition also it is fetching correct results.
 
--Praveen G
Praveen Guntuka,
praveen_guntuka@yahoo.com
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 14 Jun 2013 at 7:52am
You can do this without using Excel by leveraging features in your database.  You don't mention what type of database you're connecting to, but in both Oracle and SQL Server (possibly in other DBs as well...) you can set up a "link" from one database to another.  Once that's done, you can do one of two things:
 
1.  Create a view in one of the databases that will join the data together in a UNION query.
 
2.  Connect to one of the databases.  Then create a command (SQL Select statement) in your report that is a UNION query like this:
 
Select <fields required in the report>
from Current
where <filter the data>
 
UNION
 
Select <fields required in teh report>
from <Archive table through link>
where <filter the data>
 
The actual syntax for the tables will depend on the database type.  In Oracle it would be something like this:
 
Archive@ArchiveDB
 
In SQL Server it would be something like this:
 
dbo.ArchiveDB.Archive
 
-Dell
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.