Hi, I have a doubt in MS SQL, The below condition in the WHERE clause as you can see,
"Where COTDetails NOT BETWEEN 32 AND 63 OR COTDetails is NULL",
I want to the WHERE clause in such a way that the COTDetails is not between 32 and 63 and also is NULL, OR condition does not satisfy my condition.
Any help appreciated

i shall make my question more clearer, say my COTDetails has values from NULL, 1...... 100, i want to leave data that is not between 32 and 63, everything else, including null should be considered, but in my query, wen i use not between 32 and 63 , i do not get null values in the result.

Is COTDetails a column in a table ? if so do the following for where clause:


This works for me when selecting customers using their ID column.

Also don't forget to put " " on each end of your SQL statement.

Edited 4 Years Ago by ChrisHunter

"Where COTDetails NOT BETWEEN 32 AND 63 OR COTDetails is NULL" is working fine,
@ChrisHunter : the query which you gave will not result the null values, but I wanted null values as well. Thank you.

This question has already been answered. Start a new discussion instead.