How to query a field for entries with too few/many digits

V

venus as a boy

I was told to run this query to find social security numbers which don't have 9 digits

NOT LIKE "###-##-####"

I tried typing it directly into the 'Criteria' row under SSN and it brought up all the SSN's. The only two fields are ssn and New ID.

I tried right clicking and pressing build... I get the impression that it's the same difference and my first try.

Thanks
 
A

Arvin Meyer

Add a column which looks like this:

Expr1: Len([SSN])

Then as a criteria use:

<9

or you can also simply sort ascending and see everything sorted from the
fewest to to most.

Now you get my standard rant. Unless this database is a payroll database or
one where an SSN is required by law, you should not be storing SSN's at all,
and especially not in a database which can be easily cracked by the
"badguys" SSN's are not good identifiers partially because of error (as you
have found out) and partially because of illegal aliens and fraud. More than
30 million SSN's are duplicates or fraudulent. Therefore it is useless as an
identifier. You can be fined heavily if they are lost as part of a medical
database. Moreover, many people will sue your butt off if you ever
mis-handle their SSN.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

venus as a boy said:
I was told to run this query to find social security numbers which don't have 9 digits

NOT LIKE "###-##-####"

I tried typing it directly into the 'Criteria' row under SSN and it
brought up all the SSN's. The only two fields are ssn and New ID.
I tried right clicking and pressing build... I get the impression that
it's the same difference and my first try.
 
Top