hmmm...

chcr

Too cute for words
Okay, here's the deal. I wrote a query in Excel to query an Access database (that I created). One of the fields is account number, so no negatives. Don't you wonder why the query returns different data if I set my criteria as "not equal to" zero than it does if I set the criteria as "greater than" zero? I know I do. BTW, I've run a report to double check my data returns, "greater than" zero returns the correct data.
WTF???? :shrug:
 

chcr

Too cute for words
Luis G said:
right, WTF...

what's the SQL query it is using for both cases?

This one is correct:

SELECT `current month`.HSTR, `current month`.HDAT, `current month`.HCTP, `current month`.HCCD, `current month`.HCAT, `current month`.HITM, `current month`.HMFG, `current month`.HQTY, `current month`.HCST, `current month`.HSLS, `current month`.HCUS
FROM `current month` `current month`
WHERE (`current month`.HCTP='a') AND (`current month`.HCAT>='01' And `current month`.HCAT<='10') AND (`current month`.HMFG='g') AND (`current month`.HCUS>0)
ORDER BY `current month`.HSTR, `current month`.HDAT

This one is not:

SELECT `current month`.HSTR, `current month`.HDAT, `current month`.HCTP, `current month`.HCCD, `current month`.HCAT, `current month`.HITM, `current month`.HMFG, `current month`.HQTY, `current month`.HCST, `current month`.HSLS, `current month`.HCUS
FROM `current month` `current month`
WHERE (`current month`.HCTP='a') AND (`current month`.HCAT>='01' And `current month`.HCAT<='10') AND (`current month`.HMFG='g') AND (`current month`.HCUS<>0)
ORDER BY `current month`.HSTR, `current month`.HDAT

I don't see any other difference. Weird, huh?
 
Top