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

make a raport who need info from 2 DB ...

Status
Not open for further replies.

bogtom

Programmer
Jun 11, 2001
31
US
I have 2 db Lotus Notes (it's similar with another db...) and I need to union 2 similar (exact) views (like 2 table) and to obtain a raport. How can I make this ? Thanks !
 
Build a report on one view - assume the SQL statement looks like this
SELECT
Orders.`Order ID`, Orders.`Order Amount`, Orders.`Order Date`
FROM
`Orders` Orders
WHERE
Orders.`Order Date` >= {ts '1997-06-22 00:00:00.00'} AND
Orders.`Order Date` < {ts '1997-07-23 00:00:00.00'}
ORDER BY
Orders.`Order Date` ASC
In the Database|Show SQL Query, manually edit the SQL statement so it looks like this - differences in bold
SELECT
Orders.`Order ID`, Orders.`Order Amount`, Orders.`Order Date`
FROM
`Orders` Orders
WHERE
Orders.`Order Date` >= {ts '1997-06-22 00:00:00.00'} AND
Orders.`Order Date` < {ts '1997-07-23 00:00:00.00'}
UNION
SELECT
Shipments.`Shipment ID`, Shipments.`Amount Billed`, Shipments.`Ship Date`
FROM
`Shipments` Shipments
WHERE
Shipments.`Ship Date` >= {ts '1997-06-22 00:00:00.00'} AND
Shipments.`Ship Date` < {ts '1997-07-23 00:00:00.00'}
ORDER BY
3
ASC Malcolm Wynden
Authorized Crystal Engineer
malcolm@wynden.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top