Riks
Sep 25th, 2006, 03:16 AM
Hi all
Being very unxperienced with SQL i came across a little problem:
I want to have certain criteria to my sql-query, including this one:
get all entries where orderID > 0 and all entries where orderID = 0 (but only where a second value = 0)
Here's what i tried myself (failing..):
SELECT * FROM otime
WHERE cust LIKE 'some name' AND ans LIKE 'hk' AND OrderID > 0 OR (orderID = 0 AND mamID = 0) AND
base = 1 ORDER BY oDate desc
This query does not give the wanted entries, can someone please help me create the correct query?
Being very unxperienced with SQL i came across a little problem:
I want to have certain criteria to my sql-query, including this one:
get all entries where orderID > 0 and all entries where orderID = 0 (but only where a second value = 0)
Here's what i tried myself (failing..):
SELECT * FROM otime
WHERE cust LIKE 'some name' AND ans LIKE 'hk' AND OrderID > 0 OR (orderID = 0 AND mamID = 0) AND
base = 1 ORDER BY oDate desc
This query does not give the wanted entries, can someone please help me create the correct query?