I need to be able to make a query that shows me the products that were not sold in a range of dates.
The Database:
The table:
select p.ProductID,p.ProductName,p.CategoryID,o.OrderDate,DAY(o.OrderDate) as 'Dia Vendido',MONTH(o.OrderDate) as 'Mes Vendido',YEAR(o.OrderDate) as 'Año Vendido'
from Products p join [Order Details] od on p.ProductID = od.ProductID
join Orders o on o.OrderID=od.OrderID
where p.Discontinued = 0
and p.CategoryID = 8
and YEAR(o.OrderDate)=1996
and (o.OrderDate not between '1996-08-01' and '1996-08-15')
It's wrong, because it should come out like this: