Domino Code Fragment

Code Name*
DBLookup for a Range
Date*
02/13/1999
Source (or email address if you prefer)*
RLatulippe@romac.com
IP address:.18.118.102.225
Description*
Returns a value (i.e. Approver for a specified dollar amount) which relates to a range of values
Type*
Formula
Categories*
List Processing/Sorting
Implementation:
Modify constants
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
To use a DBLookup to return a text field (i.e. Approver for a specified dollar amount) which relates to a range of values, follow this tip:

Your criteria:
Low Amount High Amount Approver
$0                      $499 Bill Smith
$500                    $2,499 Fred Jones
$2,500                    $4,999 Mike Williams
$5,000                               Joe Smith


Set up the view this way:
Column1: Formula:  @Text(LowAmount)+"@"+ApproverName

0@Bill Smith
500@Fred Jones
2,500@Mike Williams
5,000@Joe Smith


LOOK := @DbColumn(""; ""; VIEW; 1);
LOW := @TextToNumber("0" + @Word(LOOK; "@"; 1)) -1;
NAMES := @Word(LOOK; "@"; 2);
A := @Left(@Text(LOW -
AMOUNT); 1);
@Subset(@Trim(NAMES : @Right(A + NAMES; "-")); -1);