In between for text format

casanovacasanova Member Posts: 194
edited 2013-11-27 in NAV Three Tier
hi all
i want to filter some group of data using "in between" for text format

lets say i have group:
Group 1 A J
Group 2 K S
Group 3 T Z

if i put B, it means in group 1
if put L, it means in group 2

how to setrange / setfilter that?
thx

Comments

  • landlordlandlord Member Posts: 18
    Try something like this:


    Chr := 'A';
    EVALUATE(AsciiValue,FORMAT(Chr,0,'<NUMBER>'));
    IF AsciiValue >= 65 AND AsciiValue <= 74 THEN
    RETURN Group1
    ELSE IF AsciiValue >= 75 AND AsciiValue <= 83 THEN
    Return GROUP2
    ELSE IF AsciiValue >= 84 AND AsciiValue <= 90 THEN
    Return GROUP3;
    ELSE ERROR('Wrong character %1', Chr);
  • casanovacasanova Member Posts: 194
    landlord wrote:
    Try something like this:


    Chr := 'A';
    EVALUATE(AsciiValue,FORMAT(Chr,0,'<NUMBER>'));
    IF AsciiValue >= 65 AND AsciiValue <= 74 THEN
    RETURN Group1
    ELSE IF AsciiValue >= 75 AND AsciiValue <= 83 THEN
    Return GROUP2
    ELSE IF AsciiValue >= 84 AND AsciiValue <= 90 THEN
    Return GROUP3;
    ELSE ERROR('Wrong character %1', Chr);

    hi Landlord
    but this grouping thing is dynamic
    how do i filter in records
    thx
  • landlordlandlord Member Posts: 18
    I am not sure that I completely understand your question.
    Can you post a couple of rows from your table and explain in more details what you want to accomplish?

    Thanks.
  • KishormKishorm Member Posts: 921
    Assuming the Groups table has fields named Group, StartLetter and EndLetter then something like...

    SETFILTER(StartLetter, '..%1', SearchLetter);
    SETFILTER(EndLetter, '%1..', SearchLetter);
Sign In or Register to comment.