select range between letters
Visual Basic 6 Sp5
SQL Server 2000
--------------------------
i want to make sql select to select items between two words like
select * from items where itemno >=ab and itemno<= dr
itemno is nvarchar(15)
but these not give the correct values
Is there any way to solve these to be able to select between two letters or numbers value
Thanks
Re: select range between letters
1. put strings in single quotes
2. try using a wildcard. i.e. WHERE itemno >= 'ab*'
(I can't remember if wildcard is * or % in SQL Server)
how big is your table though? i fear that the above would be slow on big tables, so maybe someone else has a better solution..
Re: select range between letters
Quote:
Originally Posted by Zeb
2. try using a wildcard. i.e. WHERE itemno >= 'ab*'
(I can't remember if wildcard is * or % in SQL Server)
The wildcard is %
Re: select range between letters
hay all
i will give example for data
values
1
2
3
4
10
11
12
ap-512
acd-42f
sfv2-s
a9-632
.
.
etc
suppose i want only records from 10 to a9-632
it must give
10,11,12,a9-632 only
all fields is nvarchar type
i try using sum ascii of value and save its value in field and when i want retrive any data i use sum ascii for number like
12 ascii = 49+48=99 and so on
but the problem that ascii sum value of 12 is same 21 and that not solve the problem