How to group by first character?

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

Guest

In my query, I need to group by only the 1st character of a field called
"text code" and don't know how to do that. Can someone please help?

For example, codes like "A-KKC-OPE" and "A-DSA-IIP" need to be grouped
together.

Thanks

J
 
Jannoth said:
In my query, I need to group by only the 1st character of a field called
"text code" and don't know how to do that. Can someone please help?

For example, codes like "A-KKC-OPE" and "A-DSA-IIP" need to be grouped
together.

SELECT Left([text code], 1), OtherFields...
FROM TableName
GROUP BY Left([text code], 1)
 
Back
Top