Getting the year and month from Orders

select od.OrderID,p.CategoryID, 
year(o.OrderDate) year, month(o.OrderDate) month

from [Order Details] od 
	left outer join Products p on p.ProductID = od.ProductID
    left outer join Orders o on o.OrderID = od.OrderID 

Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com