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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

numeric fields 1

Status
Not open for further replies.

DBrack

MIS
Mar 12, 2004
33
0
0
US
Hello,

I have to select only values that are numeric and length 7 from a table. Such as 1234567, 9092333 etc.. Values such as a190802, aaaaaaa, 10/2233 etc should not be selected. Any help? Thanks
 

Try:
Code:
Select * From MyTable
  Where LENGTH(Ncol) = 5
    And TRANSLATE(Ncol,'~0123456789','~') Is NULL;
[3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 

OOps, type length()=7!


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top