|
-
February 15th, 2005, 07:38 PM
#1
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
-
February 15th, 2005, 09:09 PM
#2
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..
-
February 16th, 2005, 01:31 AM
#3
Re: select range between letters
 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 %
-
February 19th, 2005, 08:27 AM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|