Built-In Text Functions & Queries

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

Guest

I need a query that will select records based on
the 'serial number' field which is a text field of eight
(8)characters in length.

I need the query to select records where the 5th
character from the right in the 'serial number' field is
the character '1'.

I am only fimilar with defining functions based on the
Built-IN functions of Access 2000 as they are used within
MS Access queries... I not fimilar with VB coding at all.

Would the 'Right$' or the 'Left$' or the 'MId' Text
Functions work for me here ?

All comments welcomed...thanks.

KMD
 
In your query add a calculated field on your serial number field like:
Exp1: Mid([serial number],Len([serial number])-5,1)
which will return the fifth character from the right (as a text string),
regardless of length. You can use your filter (i.e. "1") on this field. Just
make sure to change "serial number" to the actual field name if different!

HTH,
Nikos
 
FieldName: SerialNumber
Criteria: Like "*1????"

Or if Serial number is all numeric characters

Criteria: Like "*1####"
 
Back
Top