?find rows where penultimate digit in a 9 number code in a column

  • Thread starter Thread starter AK
  • Start date Start date
A

AK

As part of a research project I am looking at a database of approximately 33
000 people in microsoft access 2003. One of the columns is a 9 digit code
(all numbers). I need to select all people (rows) where the penultimate digit
in the code is the number 3. I have tried a query with "#######3#" but this
didn't work. I would be very grateful for any suggestions.
 
That will return rows with 3s anywhere in the first eight digits.

You need to use

Like "???????3?"

unless you're using ADO, in which case you'd use

Like "_______3_"

(that's 7 underscore characters in a row before the 3, and one underscore
character after the 3)
 
Another option would be to put something like below in a field of a query:

The3: Mid([TheFieldName],8,1)

Then make the criteria = 3.
 
My mistake, you're right. The question mark at the end insures that the 3
has to be the second last digit.

Sorry about that.
 
Back
Top