on ‎2014 Dec 12 3:22 PM
I want a query something similar to the below condition . This does not work...how should I do?
WHERE
tblMaterial.mat_type IN(1,3,7) AND
CASE Len(@Mat2)
WHEN 0 THEN
tblMaterial.mat_nr = @Mat1
ELSE
tblMaterial.mat_nr Between @Mat1 And @Mat2
END
ORDER BY
tblMaterial.mat_nr
Request clarification before answering.
BETWEEN is a comparison operator, it doesn't assign values, so it's not clear what you want to happen when Len(@Mat2) is not 0.
Perhaps it would be best to explain how you want the WHERE clause to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.