Skip to Content
author's profile photo
Former Member

How to select a field containing only alphabet.

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Aug 20, 2007 at 05:57 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 28, 2007 at 10:09 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded