rodrunner79
IS-IT--Management
Ok, here's the problem: I have to 2 tables, one has a packslip # (Table A) and one as an invoice # (Table B). They are related by the PO number. I need to build a query where the return set contain the Item Code, Packslip # and Invoice # where both packslip # and invoice # are not null.
Here's what I got.
When I run the query, the return set shows all records that have invoice numbers and some of these records have packslip numbers that are NULL. The first condition is met but not the second. Why?
It must not show records that have NULL packslip even if they have an invoice number and vice versa.
16 hours ago - 3 days left to answer.
Additional Details
By the way, I'm trying to the this in SQL Server Management Studio 2008. I'm connected to a SQL Database
Can't means won't try.
Here's what I got.
Code:
SELECT Orders_PkSlp.ItemCode, Orders_PkSlp.PkslpNo, Orders_Invoice.InvNo
FROM Orders_PkSlp LEFT OUTER JOIN
Orders_Invoice ON Orders_PkSlp.PONum = Orders_Invoice.PONum
WHERE (Orders_Invoice.InvNo IS NOT NULL) AND (Orders_PkSlp.Pkslip IS NOT NULL)
When I run the query, the return set shows all records that have invoice numbers and some of these records have packslip numbers that are NULL. The first condition is met but not the second. Why?
It must not show records that have NULL packslip even if they have an invoice number and vice versa.
16 hours ago - 3 days left to answer.
Additional Details
By the way, I'm trying to the this in SQL Server Management Studio 2008. I'm connected to a SQL Database
Can't means won't try.