SQL BETWEEN command

antifashionpimp

Registered User.
Local time
Today, 13:26
Joined
Jun 24, 2004
Messages
137
Here's an easy one for the SQL gurus! (I think it's easy :) )

I am using the syntax BETWEEN...AND in one of my query to include a range that is between x and y.
I have a suspision that if x=1 and y=5 then it will give 2,3,4 and exclude the values 1 and 5. Am I right?

Secondly, if I was right in my 1st question, is there syntax which I can specify a range of values, and automatically include the range minimum and maximum values? I.E. so that the values will then be including 1 and 5.
I also want to avoid using <= and >=, as this will increase the length of my SQL string, which is not good in my situation.

Thanks for the help!

jean
 
Last edited:
Between is inclusive. Both 1 and 5 would be included.
 
Yep, youre right. Thanks Pat!
 

Users who are viewing this thread

Back
Top Bottom