View Single Post

   
  #6 (permalink)  
Old 04-24-2008, 07:07 PM
Gert-Jan Strik
 
Posts: n/a
Default Re: How to find records with length greater than 17

ciojr@yahoo.com wrote:
>
> On Apr 21, 3:36 pm, "Plamen Ratchev" <Pla...@SQLStudio.com> 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
Reply With Quote