August 31, 2009 at 7:48 am
I need to filter on my where clause...where class_codes excludes every code from 700-799.
What is the bext way to write this?
This is how it is now:
where
ln.acct_type = 'ML'
and
ln.class_code <> 710
I need it to be something like
and
ln.class_code <> (between 700 - 799)
Obviuosly not the correct syntax..
August 31, 2009 at 7:50 am
where ln.acct_type='ML' AND
(ln.class_code 799)
August 31, 2009 at 7:52 am
Many Thanks !!!!
August 31, 2009 at 9:37 am
Doesn't bring back the expected results...
is there another way to write this?
August 31, 2009 at 9:46 am
Checkai gave you exactly what you asked for. If it does not work, how about showing us an example of some data that you want filtered out that this solution is not filtering out for you. Here's a link on how to properly form a post to get the best, fastest help. We'll need table DDL and readily consumable test data to continue.
http://www.sqlservercentral.com/articles/Best+Practices/61537/"> http://www.sqlservercentral.com/articles/Best+Practices/61537/
August 31, 2009 at 9:56 am
Yes he did and I'm grateful.
My verbage was entirly incorrect. I apologize, rough weekend.
Using his method the proc is reeeeally slow, is ther another way to write the same thing but may run faster?
August 31, 2009 at 10:01 am
What does the query plan look like? Do you have an index on the account type or class code columns?
August 31, 2009 at 10:46 am
does that mean you'll be updating your verbage to get an answer that you're interested in?
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply