View Full Version : What is wrong with this Query?


jaxxstorm
03-14-2007, 06:36 AM
SELECT Orders.DelAdd1 AS Street, Orders.DelAdd2 AS [Street 2], Orders.DelTown AS Town, Orders.DelCounty AS County, Orders.DelPostcode AS Postcode, Sandwich.SandwichName AS Sandwich, sum(Orderline.Quantity) AS Quantity
FROM Orders, Orderline, Sandwich
WHERE Orderline.Sandwichno=Orders.SandwichNo and Orders.DeliveryDate=[Please enter Today's Date]
GROUP BY Orders.DelPostcode;

It says I've not specified street as an aggregate function, but I don't want to!

pbaldy
03-14-2007, 07:58 AM
Which address do you want to show when there are more than one in a postcode? Each field in the SELECT clause must either be part of an aggregate function or be present in the GROUP BY clause.