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

2 DB's fiels in one report

Status
Not open for further replies.

MULTIUSER

Instructor
Feb 19, 2006
2
BE
Hello

I have this problem;
i have 2 db's with names and adresses.

Cus.name
cus.adres

and

sup.name
sup.adres

I wont to design a report with al the names and adresses in one report (to make a telephone book).

Thanks
 
You could try a union all statement if these are two tables from the same type of datasource. I see from another post that you are using CR 8.5, and in 8.5 you can't change the initial select statement, so first create a report that uses the Cus table. Place the name and address fields on the report, and then go to database->show SQL query which will show something like:

SELECT
Cus.`name`, Cus.`adres`
FROM
`Cus` Cus

At the end of this statement, add:

Union All

SELECT
sup.`name`, sup.`adres`
FROM
`sup` sup

Note that there must be the same number of fields in each half of the union all, and that they must be in the same order.

When you go to preview, the {Cus.name} and {Cus.adres} fields will now include names and addresses from both tables.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top