October 20, 2003 at 1:11 pm
I am using a between operator to compare characters and unable to figure out the following.
The following code only prints 'ITS HERE'.
Do I need to chekc for any Collation settings? Thanks
if '8L5' between '600' and '999'
print 'ITS HERE'
if '8L5' between '600' and '699'
print 'ITS HERE IS BETWEEN 600 AND 699'
if '8L5' between '700' and '799'
print 'ITS HERE IS BETWEEN 700 AND 799'
if '8L5' between '800' and '899'
print 'ITS HERE IS BETWEEN 800 AND 899'
if '8L5' between '900' and '999'
print 'ITS HERE IS BETWEEN 900 AND 999'
October 20, 2003 at 1:59 pm
As you're comparing characters, each is considered separately. Any letter character has an ASCII value greater than that of a number character. Perhaps you want something like this:
IF '8L5' BETWEEN '800' AND '8ZZ'
or perhaps just:
IF LEFT('8L5',1) = '8'
--Jonathan
--Jonathan
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply