cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving records from both source and linked tables

Former Member
0 Kudos

Hi,

I'm looking for some help with a report I'm trying to create in my ordering and invoicing system. This report compares the items and prices on an order with the items and prices on the related invoice.

The order table contains the fields:

ORDER_NOITEM_NOITEM_DESCPRICE
1123456Paper2.00
1234567Staples1.00

There are two invoice tables, one with header information and one with item information. The header table looks like:

INV_NOORDER_NOTOTAL_VALUE
11113.50

The line table looks like:

INV_NOITEM_NOITEM_DESCPRICE
111123456Paper2.00
111345678Different Staples1.50

In this example, the paper is on both the order and invoice, but we ordered one type of staples and were invoiced for a different type of staples with a different item number.

I've created a report where I've linked the tables (the invoice table is the main table) using the Order number and the item number using a left outer join. The report contains: Invoice Number, Order Number, Item Number, Item Description, Invoice Price, and Order Price

This displays the two lines which were on the invoice - showing a null value in the Order Price column for the staples - but I'd like the report to also show the original order line, with a null value in the Invoice Price column.

Is that possible?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Bump, anyone able to assist?

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

You'd need to Join from the Invoice Header table to the Line Table on the 'INV NO' field via a LEFT JOIN.

You'd then need to Join from the Line Table to the Order table on the 'ITEM NO' field via a 'FULL OUTER JOIN'.

If you don't see the Full Outer Join option, you'd need to create a SQL Query and use that as the report's datasource.

-Abhilash

Former Member
0 Kudos

Thank you, I'll give that a try.

Answers (0)