Hi all,I'm working on a website that uses sales data to make tables.In my current table I'm trying to work out revenue. I have been successful in doing this however I am having difficulties pulling any other colums from the table.This is my working revenue code. This pulls Sales from on table and Price from another and Multiplie sthem together.$describeQuery = "SELECT SUM(Products.Price * MonthlySales.SalesVolume ) as revenue From Products INNER JOIN MonthlySales ON(Products.ID = MonthlySales.ProductCode )GROUP BY Products.ID ";
Now I want to be able to Pull the name and filter the data by year but I don't know the correct syntax.$describeQuery = "SELECT Name, SUM(Products.Price * MonthlySales.SalesVolume ) as revenue From Products WHERE year = 1990INNER JOIN MonthlySales ON(Products.ID = MonthlySales.ProductCode )GROUP BY Products.ID ";
This is what I thought would be correct but the query keeps failing.Any ideas?Thank you