all groups > sql server mseq > january 2006 >
You're in the

sql server mseq

group:

Need help with Simple script



Need help with Simple script bluesrock12000
1/30/2006 9:00:37 AM
sql server mseq: Example data:

column1 column2
abcs12 123456
asdf-af 1234
asrlkk' 123456789

What I need to do is capture the data that does not have exactly 6 numeric
numbers in column2. So the desired result would display rows 2 & 3.

Any help would be appreciated,

Thanks in advance.

Re: Need help with Simple script Hugo Kornelis
1/30/2006 11:47:22 PM
[quoted text, click to view]

Hi Dwayne,

If column2 is defined as a character datatype:

SELECT column1, column2
FROM YourTable
WHERE column2 NOT LIKE '[0-9][0-9][0-9][0-9][0-9][0-9]'

Or, if column2 is defined as an integer:

SELECT column1, column2
FROM YourTable
WHERE column2 < 100000
OR column2 > 999999

--
Re: Need help with Simple script Nigel Rivett
3/20/2006 9:17:28 AM
where column2 like'%[^0-9]%'
or datalength(column2) <> 6


[quoted text, click to view]
AddThis Social Bookmark Button