I need help in joining two tables where the invoice # is not unique. The same invoice number can exist in different branches.
Invoice_Header
-Invoice_Number -Invoice_Total -Branch
-79322 -259.00 -11051
-79322 -450.00 -32165
Invoice_Lines
-Invoice_Number -Hrs -Branch
-79322 -6.0 -11051
-79322 -36.5 -32165
This is a sample of my query..
from invoice_lines Right Outer Join
Invoice_header on invoice_lines.invoice_number = Invoice_header.invoice_number
My query is pulling the invoice numbers and all data from Invoice_Lines correctly but it is not pulling the data from Invoice_Header properly. It only brings in the first invoice total amount of 259.00 and does not show the other total. Any suggestions would be helpfull.
Diana
Invoice_Header
-Invoice_Number -Invoice_Total -Branch
-79322 -259.00 -11051
-79322 -450.00 -32165
Invoice_Lines
-Invoice_Number -Hrs -Branch
-79322 -6.0 -11051
-79322 -36.5 -32165
This is a sample of my query..
from invoice_lines Right Outer Join
Invoice_header on invoice_lines.invoice_number = Invoice_header.invoice_number
My query is pulling the invoice numbers and all data from Invoice_Lines correctly but it is not pulling the data from Invoice_Header properly. It only brings in the first invoice total amount of 259.00 and does not show the other total. Any suggestions would be helpfull.
Diana