Jim
  I would add another variable named vInvNumb 

   SET VAR vInvNumb INTEGER = 0
   SET VAR vInvNumb = .vKeyword
   SET VAR vSearchString = (.vQuotes+.vKeyword+.vMany+.vQuotes)
   -- Define Where Clause
   IF vInvNumb IS NOT NULL AND vInvNumb <> 0 THEN
     SET VAR vWhereClause = +
    ('InvoiceNumber ='& .vInvNumbv)
   ELSE
    SET VAR vWhereClause = +
     ('Control# LIKE'&.vSearchString&'OR ' + +
     'OrderNumber LIKE'&.vSearchString&'OR ' + +
     'ShipZip LIKE'&.vSearchString)
  ENDIF

Buddy



-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jim Belisle
Sent: Saturday, July 11, 2015 3:42 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - LOOKUP INTEGER WITH TEST


I have a couple of forms that use the Keyword code to look up information in
tables and with double click bring them up in another form.
I noticed if my table has an INTEGER column that I want to be part of the
possibilities it will not work because the LIKE command only looks at TEXT.
I understand I can use CTXT to change into text. How do I change the below
code to use and Integer column?
The problem column is Invoicenumber which is an INTEGER type.

GETPROPERTY Keyword TEXTVALUE vKeyword
IF vKeyword = '*' OR vKeyword = '%' THEN
   -- Define Where Clause
   SET VAR vWhereClause = ('Control# IS NOT NULL')
   PROPERTY LV_Quotes REFRESHLIST 'TRUE'
   PROPERTY LV_Quotes SET_FOCUS 'TRUE'
   PROPERTY ExportResultsAs ENABLED 'TRUE'
   GOTO Done
ENDIF
IF (SLEN (.vKeyword )) < 4 THEN
  GOTO Done
ENDIF
   SET VAR vQuotes = (CVAL('QUOTES'))
   SET VAR vMany = (CVAL('MANY'))
--   SET VAR vSingle = (CVAL('SINGLE'))
   SET VAR vSearchString TEXT = NULL
   SET VAR vWhereClause TEXT = NULL
   SET VAR vSearchString = (.vQuotes+.vKeyword+.vMany+.vQuotes)
   -- Define Where Clause
   SET VAR vWhereClause = +
   ('Control# LIKE'&.vSearchString&'OR ' + +
    'InvoiceNumber LIKE'&.vSearchString&'OR ' + +
    'OrderNumber LIKE'&.vSearchString&'OR ' + +
    'ShipZip LIKE'&.vSearchString)
   PROPERTY LV_Quotes REFRESHLIST 'TRUE'
LABEL Done
CLEAR VAR iv%
RETURN

James Belisle

Making Information Systems People Friendly Since 1990
[cid:[email protected]]


Reply via email to