Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find how many digits a field is 1

Status
Not open for further replies.

Wyldcard9

Programmer
Feb 5, 2004
82
US
Hi,

I have had some users enter social security numbers of 10 numbers instead of 9. I have since added an edit to the entry screen. However I want to find all these records so they can be corrected. I know there is data on the file of 10 numbers instead of 9. I tried this query, and got no results.

SELECT *
FROM [elvis].[EP3_14]
WHERE ID_1006 > '999999999'

ID_1006 was created, and defined before I got involved, and it is 25 characters long. I thought of doing something with the LEFT command, but wondered if there was an easier way. Thank you in advance for your answers.
 
Since it is text....

SELECT * FROM myTable WHERE len(ID_1006) > 9

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top