Wilcard characters for specific positions in a string

G

Guest

I want to create a query which asks only for the 6th-through-9th character in
a 20-character string. Is there a "not this position" wildcard character?
 
R

Rick B

You could add a new column to your query that pulls out those digits using
the MID function, then apply your parameter to that...

In a new column, put:

Mid([somefieldname],6,3)
 
J

John Vinson

I want to create a query which asks only for the 6th-through-9th character in
a 20-character string. Is there a "not this position" wildcard character?

If I understand correctly, either use Rick's Mid() function
suggestion, or a criterion of

LIKE "?????XYZ*"

to search for XYZ in the 6th-9th characters.

That said - the need to do this suggests that you're violating first
normal form. Fields should be "atomic", containing only one data
value; if bytes 6 to 9 contain a meaningful, separate chunk of
information, you may want to consider splitting this field into three
(or more) component fields. It's much easier to concatenate them for
display than to tease them apart!

John W. Vinson[MVP]
 

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