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

How to combine specific fields within 2 unrelated tables

Status
Not open for further replies.

cazellnu

Technical User
Aug 15, 2002
41
CA
I had created a report base on betrieve database. It contains two tables that had 3 fields. Table A has Order#(indexed), field_name, Tray#. Table B has Inv#(indexed), field_name, Tray#. The question is how can I combine all and only the Tray# (without duplication) within both tables and display as one field within one report?

Any suggestion will be very apperciate.
Thank You
 
I cannot join on the tray because tray from both table contains different set of tray number but I need to disaplay both
 
No one who hasn't seen your data schema can really answer that. Look at your data schema or speak to your data architect or DBA who should be able to inform you of common tables between the two tables you want to report against, that you may have to include in your report merely for linking purposes.

If you cannot feasibly link the two tables, you'll have to report against one table in the main report, and the other table in a subreport. This will be a little slower, but you won't have to worry about linking the data in the subreport to the main report.

Naith
 
The only fields that are in common within both tables are the "field name". However, It is meaningless to join the "field name" since I have no basis to place those tray in single row. I wonder if there is anywhere I can union "tray " within crystal in which similar to the function of Union within MS Access?
 
I understand that it can be done by the SQL Statement according the article within the knowledge base of crsyal decision site. However, since I have to access the data throught the ddf files, is there any alternative way?
 
is there only one value for Tray# in the Table A and one value for Tray# in Table B for a given Fieldname???

Just do an equals link on Fieldname

The if your problem is to display all of the data in a report then report the fields.

If you want to combine two fields then write a formula doing this if necessary

@combinedField

WhilePrintingRecords;

//if both fields are strings

{TableA.field} + " " + {TableB.field} ;

//Or if one is numeric use

totext({TableA.field},0) + " " + {TableB.field} ;

If this isn't your problem you will have to describe it alot better than you have done so far


Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top