Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking tables with identical data fields?

Status
Not open for further replies.

kraber

Technical User
Dec 5, 2003
10
US
I'm very new to Crystal Reports and have done very little SQL or programming. I'm hoping there is a way to do this in Crystal that isn't too complicated... My programmer buddy tells me that her solution would be to do a UNION query, but that's a bit beyond my current abilities... Not to mention the fact that when I've done a very simple UNION query I seem to lose all of the 'drag & drop' functionality of Crystal.

I need to report on a DB2 database that has a number of tables with identical data fields - the only difference is that the 'ATKT' tables are 'active', from the previous 7 days, and the 'CTKT' tables are 'history' (completed) records, > 7 days old. The data structure for the corresponding tables is identical, and there are no records that exist in both tables.

CSTC.ATKT ==> CSTC.CTKT
CSTC.ATKT_CALL ==> CSTC.CTKT_CALL
CSTC.ATKT_CALL_CMNT ==> CSTC.CTKT_CALL_CMNT
CSTC.ATKT_CMNT ==> CSTC.CTKT_CMNT


I need to be able to report on all of the records simultaneously - active and history. This is something I'll need to do often (several times a week), and I need to be able to query the data dynamically.

FWIW, I'm using Crystal Reports 7.0.

Hopefully that's enough information...

Thanks in advance!

-Karyl
 
Ask your DBA to build a View for you, that way you have reusability.

A Union would probably work, and you may be able to Left Outer your current rows to the history table if there's a common ID and the current doesn't repeat (otherwise you might create a cartesian).

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top