Oh, so "RO" is one type of wood, but the ProductID contains other stuff in addition to that?
Is it always two characters at the same location?
If so, you can use mid or substring or whatever function MSSQL uses to do this...
looks like it is SUBSTRING, so...
code:
SELECT SUBSTRING(rudProductID,6,2) AS WoodType, COUNT(*) AS WoodCount
FROM ProductionDetail WHERE rudCategory='Produced'
GROUP BY SUBSTRING(rudProductID,6,2)
If the RO (and similar values) changes position in the code then you can't do that, but probably they're in the same place?
EDITED: 20 Apr 2011 19:44 by BOUGHTONP