51 views ( last including mine) but NO response and the reason is :
No sample data
NO business rule or logic
NO table definition on this post.
Include them and i am sure people will see this with interest.
and on your post ..one blind shot.... it could be happening becaise you have OR operator with concern fourth variable.
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)