Re: How to find records with length greater than 17
- From: Gert-Jan Strik <sorry@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 23 Apr 2008 18:46:03 +0200
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
.
- References:
- How to find records with length greater than 17
- From: ciojr
- Re: How to find records with length greater than 17
- From: Plamen Ratchev
- Re: How to find records with length greater than 17
- From: ciojr
- How to find records with length greater than 17
- Prev by Date: Re: CHECKSUM to determine record changes
- Next by Date: Re: Performance question concerning varchar(max)
- Previous by thread: Re: How to find records with length greater than 17
- Next by thread: Re: Using findstr on SQL 2005 ERRORLOG file
- Index(es):