cancel
Showing results for 
Search instead for 
Did you mean: 

How to select a field containing only alphabet.

Former Member
0 Kudos

Post Author: tantk

CA Forum: General

I want to select records with only alphabet in a field.

Can't seem to find any finctions to do this in CR XI.

e.g Reference ID

ABCXYS - Select this record

173839S - Don't select

UDHHW12 - Don't select

173746 - Don't select

Thanks for the help in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Post Author: tantk

CA Forum: General

Thanks.

It gets the job done, although not very effective.

It reads thru my whole table of 2 million records before giving me the results.

It'll be great if it don't have to read thru the whole table.

Former Member
0 Kudos

Post Author: SKodidine

CA Forum: General

There might be an easier way but I just cant think of it right now. Here is a way to get you started.

Create a formula with:

numbervar i;numbervar a := 0;//for i := 1 to length({table.refid}) do(if not({table.refid}[i] in chrw(65) to chrw(122)) then a := a + 1;);//if a = 0 then 'true' else 'false';

Place this formula in the report header and suppress it. Then in your record selection criteria place this line:

{@yourformula} = 'true'

This should fetch only those records that either have a space or all alphabets for the refID.