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
 Transact-SQL (2000)
 between ....and ...

Author  Topic 

maodou
Starting Member

5 Posts

Posted - 2004-07-19 : 04:11:25

How can I get the same function,sample:

declare @data
set @data between 'J124' AND 'J129'



but it's not right,i want't know the right syntax

only test,have bug

Amethystium
Aged Yak Warrior

701 Posts

Posted - 2004-07-19 : 04:48:41
Not exactly sure what you're attempting to do here but you can't do that in SQL Server.
If you want to have a range of values, maybe put the values in a table variable? Or You could define a separate variable to hold each value you have in you range.

But anyway, something like this could work,


declare @data, @data1, @data2
set @data ='J124'
set @data1 'J129
etc...



------------->>> BREAKING NEWS!!! <<<-------------
Saddam Hussien has weapons of mass destrcution
Go to Top of Page
   

- Advertisement -