Try this:

SELECT i_pol# FROM pri_ins WHERE (ISALPHA(SGET(i_pol#,1,1))) = 1 AND
(ISDIGIT(SGET(i_pol#,1,(SLEN(i_p;ol#))))) = 1

The (ISALPHA(SGET(i_pol#,1,1))) = 1 tests the first character of the policy
number to see if it is alpha, and the
(ISDIGIT(SGET(i_pol#,1,(SLEN(i_p;ol#))))) = 1 tests the last character of
the policy number to see if it is a digit.


Emmitt Dove
Manager, Converting Applications Development
Evergreen Packaging, Inc.
[email protected]
(203) 214-5683 m
(203) 643-8022 o
(203) 643-8086 f
[email protected]

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of John Croson
Sent: Friday, May 14, 2010 14:24
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Query for character range

Thanks, Guys.

This really isn't working for me.

The data I'm querying on is an insurance policy number, some start with
letters, some not. Some end with letters, some not. I'm trying to find
those that start with a letter and end with a number.

Here are some results from a few tests I've run.

This works, and only returns lines that begin with a letter;
SELECT i_pol# FROM pri_ins WHERE i_pol# >= 'A%'

This doesn't work, and returns nothing even though there are lines that
end in a letter, in addition, a number in the place of 'Z' also fails.
SELECT i_pol# FROM pri_ins WHERE i_pol# <= '%Z'

Obviously BETWEEN won't work since RBase doesn't know how to match lines
ending in letters.

Am I going to have to resort to cursors, or worse yet, port this to a MS
Sql DB?


Reply via email to