Query criteria to see middle 4 characters/12 char field

R

Ray B

In a select query I have a text field that is 12
characters long that
follows the pattern of 3 numbers, a dash, 4 numbers, a
dash, 3 numbers.
Example is 123-4567-001. I want the query to remove the
first four and the
last four characters so in the example I would only see
4567. I need this
as the middle four characters are the chronology on how
projects are entered
into the system which I need to synch with another
database. What critieria
do I need to apply or how would I do this. Thank you.
 
F

fredg

In a select query I have a text field that is 12
characters long that
follows the pattern of 3 numbers, a dash, 4 numbers, a
dash, 3 numbers.
Example is 123-4567-001. I want the query to remove the
first four and the
last four characters so in the example I would only see
4567. I need this
as the middle four characters are the chronology on how
projects are entered
into the system which I need to synch with another
database. What critieria
do I need to apply or how would I do this. Thank you.

Add a new column to the query.
MiddleFour:Mid([Fieldname],5,4)
 

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

Top