I want to make a query with two conditions : to include all the orders having orders.Audit = > True and also all the orders where orders.Suborder = true.
I want to exclude the orders that have no criteria as Audit = True or Suborder = True.
I cannot do it, since in the query I have built there are also orders which have neither Audit = True or Suborder = True
How can I exclude those last order from the query? I did try to add in the where clause orders.suborder = True but the query does not give the right results
SELECT orders.orderid, orders.audit, orders.SubOrder
FROM orders INNER JOIN [order details] ON orders.orderid = [order details].OrderID
GROUP BY orders.orderid, orders.audit, orders.SubOrder
HAVING (((orders.orderid)>=(SELECT Max(orders.orderid) FROM orders WHERE orders.Audit =True)));
In our database we begin calculating from the orderid that has Audit = true. There is only one order with Audit = True, but after this order there are many orders that have Suborder = True and a lot of orders that have no restrictions.My first task is to calclate the quantities from all the orders where Audit => true or Suborder = true. I will be very grateful for any help in this difficult assignment.
I can send an example if needed.
I want to exclude the orders that have no criteria as Audit = True or Suborder = True.
I cannot do it, since in the query I have built there are also orders which have neither Audit = True or Suborder = True
How can I exclude those last order from the query? I did try to add in the where clause orders.suborder = True but the query does not give the right results
SELECT orders.orderid, orders.audit, orders.SubOrder
FROM orders INNER JOIN [order details] ON orders.orderid = [order details].OrderID
GROUP BY orders.orderid, orders.audit, orders.SubOrder
HAVING (((orders.orderid)>=(SELECT Max(orders.orderid) FROM orders WHERE orders.Audit =True)));
In our database we begin calculating from the orderid that has Audit = true. There is only one order with Audit = True, but after this order there are many orders that have Suborder = True and a lot of orders that have no restrictions.My first task is to calclate the quantities from all the orders where Audit => true or Suborder = true. I will be very grateful for any help in this difficult assignment.
I can send an example if needed.