By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,661 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

using where clause to find Len of a column that has less than a number

P: 4
my table has a columnn 'name', I want to find only the name are more than 25 characters; I did this, but it doesn't work; can anybody help me with that. thanks;

where max(len(ltrim(rtrim(name)))) > 25
Feb 21 '13 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 10K+
P: 12,430
Drop the max. That's only if you want to aggregate rows together. That's not what you want to do, you want to examine each row.

Besides, you can't use aggregate functions in the where clause because that operates at the row level.
Feb 21 '13 #2

P: 4
how can I do it? I want to create a report that shows only names more than 25 characters.
Feb 21 '13 #3

Expert Mod 10K+
P: 12,430
I already told you how to do it in the previous post. Remove the max.
Feb 21 '13 #4

Post your reply

Sign in to post your reply or Sign up for a free account.