Subsonic Complex SQL conditional statements - Condition1 And (( Condition2 And Condition3) OR (Condition4 And Condition5))
How do I build a query in Subsonic that of this format:
Condition1 And (( Condition2 And Condition3) OR (Condition4 And Condition5))
The originial SQL Query is:
SELECT *
FROM Events
WHERE Deleted=false
AND ((DateModified IS NOT NULL AND DateModified BETWEEN @date1 AND @date2) OR (DateModified IS NULL AND DateCreated BETWEEN @date1 AND @date2))
I've tried arious approaches, using AndExpreession(), OrExpression(), OpenExpression(), CloseExpression() but I cant seem to get the desire开发者_StackOverflowd result.
Thanks in advance for your answer.
For that particular query, why not get rid of all the parenthesis and simply let the operator precedence take over:
Condition1 And Condition2 And Condition3 OR Condition1 And Condition4 And Condition5
精彩评论