Contents
Display Legacy Contents

 Print
    Lookup      
This Function returns a <boolean>, which is the result of a search for a record in a Database, in compliance with the specified Conditions.

Parameters

Table <unquoted string>
  Table to perform the search on.
   
Column <unquoted string>
  Column where to verify the condition.
   
Operator <unquoted string>
  Operator to apply when verifying the condition.
The Possible values for this parameter are:

  <     Less than.
  >

Higher than.
  <=

Less than or equal to.
  >=

Higher than or equal to.
  =     Equal to.
  <>     Different from.
  LIKE     Like to. Use this operator to perform generic searches using character "%".
  NOT LIKE     Not like to. Use this operator to perform generic searches using character "%".
   
Value <string> or <numeric>
  Value to compare the Column to.
The type of this parameter depends on the database type of the Column.
   
(...)
   
Column <unquoted string>
   
Operator <unquoted string>
   
Value <string> or <numeric>

     
Consider the following database table "Products":

Code
Name
Stock
001
Coca Cola
100
002 Pepsi Cola 200
003
Pork Chops
300
   
     
Example 1
  Example 2
Lookup(Products, Stock, >, 100)

Result = TRUE
  Lookup(Products, Stock, >, 300)

Result = FALSE
     
Example 3   Example 4
Lookup(Products, Stock, >, 100, Stock, < 300)

Result = TRUE
  Lookup(Products, Name, LIKE, "%Cola")

Result = TRUE
     
Example 5   Example 6
Lookup(Products, Name, LIKE, "Cola%")

Result = FALSE
  Lookup(Products, Name, LIKE, "%Cola", Stock, >, 100)

Result = TRUE

     
  • When you specify more than one condition, the operator used between the conditions is "AND". Therefore, something like "select (...) from (...) where (...) AND (...)" will be executed.

See also
Samples
Sample 1
Sample 2
 
Updated: 3/22/2013 4:15 PM