Unanswered: SELECT FROM, trouble with the WHERE bit
I'm sure this must be simple but I just can't get the syntax right.
sql="select * FROM products INNER JOIN (orderitems INNER JOIN orders ON orders.orderid=orderitems.orderid) ON products.productid=orderitems.productid where ostatus<>'Cancelled' and custid=" & valid_sql(session("custid")) & " order by orders.orderid"
That works OK but I want ostatus<>'Cancelled OR 'Uncompleted'
1: ostatus<>'Cancelled' AND ostatus<> 'Uncompleted'
using the above should return those that are (as you put it) "something else". If it is returning everything then I would be tempted to suggest that there is a flaw somewhere else in your query. It's possible that you need to wrap this section in brackets or something else, it really depends on what is happening...