Groups > Asp .Net > Data Access and ObjectDataSource Control > Re: WHERE Clause




Re: WHERE Clause

Re: WHERE Clause
Tue, 1 Apr 2008 10:29:58 +0000
This is why I asked for help - how do I use nested selects? Why shouldn't I use
OR?
Post Reply
WHERE Clause
Tue, 1 Apr 2008 10:57:52 +0000
Hi,

I am having trouble with 2 Where clauses - I am trying to adjust them so that
they keep the former meaning but also add an extra stipulation.;

  WHERE (([Z] = @Z) AND ([A] >= @A)) AND (([B] < [C]) OR (([B] = 0) AND
([C] = 0)))

 for this, I would like the second bracket set to apply as long as [C] < [P].
So I'd like to 'check' that C is less than P.


Would this work:  WHERE (([Z] = @Z) AND ([A] >= @A)) AND (([C] < [P]) AND
(([B] < [C]) OR (([B] = 0) AND ([C] = 0))))    ?


 

 

WHERE (([A] <= @A) AND ([D] = @D)) OR (([B] >= [C]) AND (([B] > 0) AND
([C] > 0))) AND ([D] = @D)) AS LogWithRowNumbersList

for this one, I would like the second set to apply as long as [C] >= [P]...

Would this work: WHERE  (([A] <= @A) AND ([D] = @D)) OR (([C] >= [P]) AND
(([B] >= [C]) AND (([B] > 0) AND ([C] > 0))) AND ([D] = @D))) AS
LogWithRowNumbersList    ?


 

Thanks for your help,

Jon
Post Reply
Re: WHERE Clause
Tue, 1 Apr 2008 12:49:08 +0000
Well we don't know. Did it work? You are the only one how can actualy test that
mess. I word of advice thou, don't use or avoid to use OR. Try to use nested
selects, between ()
Post Reply
Re: WHERE Clause
Tue, 1 Apr 2008 12:50:23 +0000
Give me dummy data like "this is my table:" and copypaste some rows .
Then tell me what the outcome is supposed to look like. See this post to
understand what i mean: Post
Post Reply
Re: WHERE Clause
Tue, 1 Apr 2008 14:25:21 +0000
It takes to long for the engine to deal with it. Give me an example of data...
so i can play with it and the return format you want.
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact