Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 WHERE fieldname.length

Author  Topic 

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2007-07-05 : 13:36:30
Hi,

My front end application just broke, trying to figure otu this answer as quick as I can

how can I select based on the character count of the column ?

For example

SELECT * from tblAnswers where response.length > 500 characters


Any help much appreciated!

Thanks! :)
mike123

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-07-05 : 13:40:20
You can use the LEN or DATALENGTH functions. Please check BOL for the differences between the two though. I always use the DATALENGTH function due to the gotcha of the LEN function.

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2007-07-05 : 13:41:31
looking now, thanks!! :)
Go to Top of Page
   

- Advertisement -