Hey everyone,I've got a problem that I can't seem to wrap my head around and figure out. It should be pretty straight forward and any help would be greatly appreciated!I've got 4 tables laid out like so:Items--ItemNumber--Item DescriptionJobSetup--ItemNumber (references Items.ItemNumber)--CylinderNumber (references Cylinder.CylinderNumber)Cylinder--CylinderNumber--ColorID (references Color.ColorID)Color--ColorID--ColorNameMy client simply wants the number of colors for each ITEM. As you can see there are multiple Cylinders for each Item and multiple colors for each Cylinder.I've tried the following query:select i.ItemNumber, i.ItemDescription, count(c.ColorID)from Items i inner join JobSetup j on i.ItemNumber = j.ItemNumberinner join Cylinder c on c.CylinderNumber = j.CylinderNumberinner join Color co on co.ColorID = c.ColorIDgroup by i.ItemNumber, i.ItemDescription, c.ColorID
and it returns data (customer wants just the ItemNumber, ItemDescription and Number of colors returned)...however, the color count seems to be wrong.Can anyone help??Please? lolThanks in advance!!