Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Obtaining a Range of values

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-03 : 09:51:42
Meeta writes "I would like to obtain a range of values, for example I want to display all categories starting from A to D.

I used "between" but does not give the correct values, like this:
SELECT * FROM try
WHERE (category BETWEEN 'a%' AND 'C%')
this return values from A to B only. This also does not work for numbers.

Is there any other way"

Jay99

468 Posts

Posted - 2002-04-03 : 10:26:51
how about

select
<columnlist>
from
try
where
left(category,1) between 'a' and 'c'


Jay
<O>
Go to Top of Page

Nazim
A custom title

1408 Posts

Posted - 2002-04-03 : 10:28:17
Check this http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=14472 (especially the one Arnold Wrote)

--------------------------------------------------------------
Go to Top of Page
   

- Advertisement -