How do I pull the first 3 characters of a field

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

Guest

I have an item number example: TIMTIMUS63042RSC3
I need to pull the first three characters example: TIM
and make it my StkSec column. And the next 3 characters example: TIM
and make it my Brand column. And the next 2 characters example: US
and make it my CtryCd column.
Could someone assist me?

Thanks
 
Try this

Select Left(FieldName,3) as StkSec ,Mid(fieldName,4,3) As Brand ,
Mid(FieldName,7,2) As CtryCd From TableName
 

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