Parse String within Query

M

Mike

I have the following string: 00737 013 33 02665 stored within my table as a
single field. I want to write a query which parses the string into the first
5 characters which would be 00737, the 11th and 12th character which would be
33. Is there a way to write a SQL statement which will parse this for me? If
I can't do it within a SQL statement, how would I do this? I ultimately want
to write a report against the query and group the data by the first 5
characters and then sub group the data by the 11th and 12th characters.

Thanks,
Mike
 
F

fredg

I have the following string: 00737 013 33 02665 stored within my table as a
single field. I want to write a query which parses the string into the first
5 characters which would be 00737, the 11th and 12th character which would be
33. Is there a way to write a SQL statement which will parse this for me? If
I can't do it within a SQL statement, how would I do this? I ultimately want
to write a report against the query and group the data by the first 5
characters and then sub group the data by the 11th and 12th characters.

Thanks,
Mike
Do you wish to combine the values?

NewColumn:Left([FieldName],5) & Mid([FieldName],11,2)
will return 0073733 from the above value.

Or keep them separate?
NewColumn1:Left([FieldName],5)
NewColumn2:Mid([FieldName],11,2)
 
Top