| Author |
Message |
bluetenth
Newbie
Joined: 16 Nov 2007
Online Status: Offline
Posts: 2
|

Topic: Combine 2 DB's Posted: 16 Nov 2007 at 11:33am |
|
I need to combine 2 databases (small) one for Spring and one for Fall student records.
The new Report has to count the Spring and Fall students and if they attended both Semesters then that value Full Year needs to be calculated as well.
ex. report output needed
Student Name Spring Fall Full Year
Mr XYZ yes yes yes Ms. ABC yes no no
totals 2 1 1
|
|
BlueTenth NYC
|
IP Logged |
|
|
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|

Posted: 19 Nov 2007 at 9:47am |
|
What kind of database are you using? That can be very important to what kinds of options are available to you.
I don't think Crystal can connect to two different databases simultaneously. You can do this sort of thing with subreports. But, that would make calculating your "Full Year" value extremely tricky.
Your best bet is to solve this problem on the data source side. There are a few options. Some databases will allow you to do a union or full outer join query, using base tables from two different databases. You may need to export information into an Excel spreadsheet, or another database, and work with it there.
Of course, as a professional developer, I can also tell you that maintaining different entire databases for each semester is poor overall design. It will cause you no end of headaches in the long run. I would highly recommend adding a column to each of your key tables to indicate which semester it belongs to, and then combine the databases. But, I do understand that that sort of redesign is not always feasible.
|
IP Logged |
|
bluetenth
Newbie
Joined: 16 Nov 2007
Online Status: Offline
Posts: 2
|

Posted: 20 Nov 2007 at 10:04am |
|
It's an MS Access DB
Maybe theres a Query I can run to do this. What do you think? Any Ideas?
|
|
BlueTenth NYC
|
IP Logged |
|
Lugh
Senior Member
Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
|

Posted: 21 Nov 2007 at 5:09am |
|
Yes. You can create a query in Access that will reference another database.
Perhaps a better option, though, is to create a third Access database.
In that database, create linked tables to each of your previous
databases. (Creating linked tables is a considerably easier and more
foolproof function that trying to reference another database in a
query.) Among other things, this will allow you to intelligently alias your tables (e.g., Spring_Enroll, Fall_Enroll), so you can keep up with what you are doing.
Then you can create a number of queries, combining the data any way you want.
(I do want to throw out another plea for redesign, though. Note that, if you want to combine three semesters of data, you have to add in the linked tables of the third database, and redesign all of your queries. Doing the above will get you a quick solution for now. But, I recommend that you also take some time to redesign the database from scratch.)
|
IP Logged |
|
wattsjr
Groupie
Joined: 25 Jun 2007
Location: United States
Online Status: Offline
Posts: 51
|

Posted: 21 Nov 2007 at 8:03am |
Hi bluetenth,
This may be a stupid question but, are you talking about 2 actual databases in separate .mdb files? Or are you talking about two tables in 1 database .mdb file?
Regards, Edited by wattsjr - 21 Nov 2007 at 8:04am
|
|
-jrw
|
IP Logged |
|
IdoMillet
Groupie
Joined: 26 Oct 2007
Location: United States
Online Status: Offline
Posts: 99
|

Posted: 21 Nov 2007 at 4:09pm |
|
Use an Access UNION ALL query to combine the two data sets into a single data set. Then, use that query as the data source in your Crystal report.
By the way, Crystal can connect to 2 data sources. The only restriction is that a join is limited to a single field in such a case.
- Ido
|
|
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
www.MilletSoftware.com
|
IP Logged |
|
fejjarific
Newbie
Joined: 01 May 2009
Location: United States
Online Status: Offline
Posts: 1
|

Posted: 01 May 2009 at 3:06pm |
Hi,
I'd like to compare development and production oracle databases and I was thinking of doing a union comand to create a huge "table" that would have stuff in DEV not in PRD and vice versa, and then compare it to DEV and PRD silmotaniously so I wouldn't have to do it with two different rports. I am familiar with commands in crystal and can combine two tables, but not of the same database. Any suggestions?
Example;
DEV
30 year fixed
15 year fixed
5/1 ARM
7/1 ARM
PRD
30 year fixed
15 year fixed
5/1 ARM
10/1 ARM
Results
7/1 ARM Not in PRD
10/1 ARM Not in DEV
THANKS!!
|
|
in an effor to make the world less confusing for all
|
IP Logged |
|
|
|