Re: How to find records with length greater than 17



ciojr@xxxxxxxxx wrote:

On Apr 21, 3:36 pm, "Plamen Ratchev" <Pla...@xxxxxxxxxxxxx> wrote:
The LEN function returns the number of characters excluding trailing blanks:

SELECT namecol
FROM Foo
WHERE LEN(namecol) >17;

The DATALENGTH function returns the number of bytes.

HTH,

Plamen Ratchevhttp://www.SQLStudio.com

Right - i dont want to include spaces.
I want to check where the first word is greater than 17

It won't do that. For example, the query above will also select the row
where namecol has a value of 'John Smithersonson'

So if Plamen's solution does not do what you want, then please some
example data and desired output.

--
Gert-Jan
.