Hi John,

Okay, here's how I would tackle this. 

Add two columns to your table with the policy number.  One called:
 
frstletter         Type   : TEXT 1   Computed: sget(i_pol#,1,1)

And another called
 
lstletter          Type   : TEXT 1   Compute:
sget(i_pol#,1,(slen(i_pol#)))    
  
Now you can select using the firstletter column to look for letters
(frstletter >= 'a') and use the lstletter column to look for numbers
(lstletter <= '9').

I hope this helps,

David Fitts
State of Maine 
Risk Management Division


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of John
Croson
Sent: Friday, May 14, 2010 2:24 PM
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