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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report merging 2 similar tables 1

Status
Not open for further replies.

Jander97

Programmer
Mar 30, 2010
2
US
I am using Crystal Reports version 11, ODBC driver to an informix database.

I have two tables, data and history that have the same field structure, where at times the data table gets dumped into the history table.

In both the tables I am working with these fields.
The primary key is session_id but I don't use it
'create_time'(epoch value) and
'progress_flag'(int "1-17")

The report should count all entries from both tables where a create_time exists within my range, broken down into groups based off progress flag

i.e.
------------------------------
March 2010

Progress Count
1 5
2 10
3 20
. 30
. 40
17 100
------------------------------

I currently have a working report, that calculates my date range converting the epoch and doing a lastfullweek off that computation, and I have it grouped and everything, but I have 2 different reports, one for each table. I would like to run a single report off of the merged data of the two tables.

Any ideas would be appreciated, thanks!
 
Do you have the option of using a command? If so, you can use a union all to merge the fields, as in:

select table.field, table.date
from table
where <etc>
union all
select history.field, history.date
from history
where <etc>

-LB
 
I had looked into using the command function, or whatever you would call it but couldn't quite piece together how to just merge my tables.

This answer was exactly what I was looking for, thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top