yet another count issue in a query

Rat1sully

Unhappy Forced codemonkey
Local time
Today, 03:50
Joined
May 15, 2012
Messages
44
apologies for creating a new thread about what seems to be a done to death topic on here but i've tried most of the solutions I can see from searching

I need a count of how many classes a piece of equipment is fitted to, at the moment i can get the number of different types of equipment fitted to a class but not vice vesa as that sums the number fitted on each vessel in each class rather than just the number of classes the equipment is fitted to

Code:
SELECT tblMEList.[Equipment Tag], Count(tblClass.Class) AS CountOfClass
FROM ((tblCat INNER JOIN tblMEList ON tblCat.[GCFS Cat] = tblMEList.[GCSF Cat]) INNER JOIN tblShipFitData ON tblMEList.[Equipment Tag] = tblShipFitData.Equipment) INNER JOIN (tblClass INNER JOIN tblPlatformList ON tblClass.Class = tblPlatformList.Class) ON tblShipFitData.Vessel = tblPlatformList.Vessel
GROUP BY tblMEList.[Equipment Tag]
ORDER BY tblMEList.[Equipment Tag];

Edit: as things stand if I make the count a normal group by I can clearly see that for the first piece of equipment there are 7 classes listed but yet it sums the total number fitted not the number of classes fitted to

edit2: and i'm trying to do it in 1 query not 2 to reduce clutter
 
Last edited:
ta I thought it would be a case of implimenting it over 2 queries which is what i had it doing already, I really need to stop posting questions on here then answering them myself before ppl reply lol
 

Users who are viewing this thread

Back
Top Bottom