BETWEEN

Determines whether an expression results in a value in a specified range. The Entity SQL BETWEEN expression has the same functionality as the Transact-SQL BETWEEN expression.
expression [ NOT ] BETWEEN begin_expression AND end_expression

Arguments

expression: Any valid expression to test for in the range defined by beginexpression and endexpression. expression must be the same type as both beginexpression and endexpression.
beginexpression: Any valid expression. beginexpression must be the same type as both expression and endexpression. beginexpression should be less than end_expression, else the return value will be negated.
endexpression: Any valid expression. endexpression must be the same type as both expression and begin_expression.
NOT: Specifies that the result of BETWEEN be negated.
AND: Acts as a placeholder that indicates expression should be within the range indicated by beginexpression and endexpression.

Return Value

true if expression is between the range indicated by beginexpression and endexpression; otherwise, false. null will be returned if expression is null or if beginexpression or endexpression is null.

Remarks

To specify an exclusive range, use the greater than (>) and less than (<) operators instead of BETWEEN.
select p from Products as p where p.ProductId Between 10 and 100
select p from Products as p where p.ProductId not between 10 and 100

Last edited Mar 25, 2013 at 8:39 AM by ansiboy, version 1

Comments

No comments yet.