Combining data from Current & History files on Crystal Report

I have 2 DBF files, one history and one current.  These 2 files are structured the same way.  I want to pull data from 2 file as if the information is in one table instead of 2.  I have and Employee File attached to each Transaction File (One Current and One History) using the employee ID as the relation with each.  I know I can setup 2 reports and have them print on the same report having one of them be a Subreport, but I would rather only have to put the filter in one instead have to key the filter in twice upon refresh.  Please help me figure this out.
Paula WardControllerAsked:
Who is Participating?
 
James0628Commented:
If you basically want the same report (same fields in the same layout), but from two different sources (current and history), you could:

 Create a report for one source, with your employee parameter.
 Save a copy of that report under a different name.
 Change the datasource in the copy to the other DBF file (I'm assuming that this will work, but I don't use DBF files, so I can't say for sure).
 Add the second report as a subreport in the first report.
 Right-click on the subreport, select "Change Subreport Links", and link the parameter in the main report to the parameter in the sub report.

 James
0
 
mlmccCommented:
You may be able to use a union query as the command.

Select Table1.* FROM Table1
UNION ALL
Select Table2.* FROM Table2

That will work if all tables are in the same database.  It may not work if they are different databases

If they are different database connections then I believe you will have to use a subreport for the history.

mlmcc
0
 
Paula WardControllerAuthor Commented:
All files are the same type DBF files (Foxpro...YUCK).  I use Crystal 10.  Where is the UNION ALL done, I've never seen this option or is the just a command that is available if you know about it.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
mlmccCommented:
You would do it in the database command but sine they are separate DBF files, I don't think it will work.

mlmcc
0
 
Paula WardControllerAuthor Commented:
Well if that won't work...I can do it with the subreport for the one of the sets of data.  They would both have the Parameter of Employee ID.  Can it be setup when we hit refresh that it only prompts for Employee ID once instead of twice?

0
 
mlmccCommented:
Yes.  I generally add the parameter to the main report then link the subreport on the related fields.

You can also link the subreport to the main report using the parameter fields.

mlmcc
0
 
mlmccCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.