Strongbow1980
Technical User
I have a few tables, but need to get data from 3 of them in 1 query. The Tables are CostCentre, OrderItems and OrderHeader
I need to run a query that will total the cost of all items purchased between certain dates for each cost centre. I can do this for all orders in the database using this query:
SELECT CostCentres.Description, Sum(OrderItems.Price) From CostCentres, OrderItems WHERE OrderItems.CostCentre = CostCentre.Code GROUP BY CostCentres.Description
But how can I limit the records to only include ones from a certain month, without grouping them by date as well?
I need to run a query that will total the cost of all items purchased between certain dates for each cost centre. I can do this for all orders in the database using this query:
SELECT CostCentres.Description, Sum(OrderItems.Price) From CostCentres, OrderItems WHERE OrderItems.CostCentre = CostCentre.Code GROUP BY CostCentres.Description
But how can I limit the records to only include ones from a certain month, without grouping them by date as well?