Variable "mid" Criteria

  • Thread starter Thread starter Ron Bajda
  • Start date Start date
R

Ron Bajda

I have an field that contains the following information:

F43845*26035
F5567891*19366
F678*00560

I need to be able to select records based on the 3 digits
after the Asterisk. (ie. 260,193,and 005)

Don't have a clue!

Could someone help me?

Thanks

Ron
 
Is there always 5 digits after the *?

If so,

mid(right(fieldname,5),2,3)

If not, I dont have a clue either :)

Steve.
 
If the field is called "Field2", type this into the Field row of the query:
Str(Mid([Field2], Instr([Field2], "*") + 1, 3))

Then select your records by typing the value you want into the Criteria row
under this field.
 
SELECT *
FROM tblTest
WHERE (((Mid$([TestText],InStr([TestText],"*")+1))="26035"));

The key point here is the use of the InStr function to get the location of
the "*" character.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Sorry,

Thats left(right(fieldname,5),3)

Steve.

-----Original Message-----
Is there always 5 digits after the *?

If so,

mid(right(fieldname,5),2,3)

If not, I dont have a clue either :)

Steve.


.
 
Back
Top