GROUP BY from partial info in field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to group a set of data by using just part of the of the
information in a field:

U02, U64, W43, H37, and H38 all represent different "models". The letter in
front (U,W,H) represent different "products". I would like to count the
number of separate "product" using the first letter from the "model" list.

Thanks
 
larry said:
I would like to group a set of data by using just part of the of the
information in a field:

U02, U64, W43, H37, and H38 all represent different "models". The
letter in front (U,W,H) represent different "products". I would like
to count the number of separate "product" using the first letter from
the "model" list.

Thanks

SELECT Left(Model,1) AS Product, Count(*) As CountOfProduct
FROM TableName
GROUP BY Left(Model,1)
 
I think the "group interval" in your grouping and sorting options will also
do this.

Rick B
 
Back
Top