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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top