I'm using MS SQL, and here is my query...
SELECT SUM(Quantity) FROM table1
WHERE [item_no]='0052556'
AND [qty_to_ship] > 0
AND [type] = 5
Interestingly, the query as it stands above returns 'NULL'...however, if I remove either one of the last 2 conditions it works fine (returns a real number)
to clarify, these queries work fine:
SELECT SUM(Quantity) FROM table1
WHERE [item_no]='0052556'
AND [type] = 5
and
SELECT SUM(Quantity) FROM table1
WHERE [item_no]='0052556'
AND [qty_to_ship] > 0
also note: 'type' is a PK, int, not null
what might be causing this?