Join Question
I have two tables orderHeader and orderDetails that have been imported from our ERP system. I have joined these on the orderNumber. orderHeader has the order number as the primary key. orderDetails is tied to orderHeader on the ordernumber field. There is a unique record in orderDetails for each order line item base on orderNumber. Therefore I have joined them on the order number. Pretty standard.:)
The problem is that not all orderHeader records have orderDetail records. For some reason, there are orders that were generated in our ERP system that do not have any line items. When I add additional fields to the query, I get errors (#Error - Invalid use of Null) in the result records.
How do I complete this query so that I only return orderHeader records that have at least 1 orderDeatil record? That would fix this issue.
Thanks.
|