Using LIKE Statement

Results 1 to 3 of 3

Thread: Using LIKE Statement

  1. #1
    Join Date
    Dec 1969

    Default Using LIKE Statement

    I am attempting to fing if a value is contained anywhere in a specific field.<BR>MBID is a number of single digit&#039s seperated by commas.<BR>VERID is a single digit.<BR>example<BR>IF MBID LIKE VERID THEN<BR>MBPRICE = "0"<BR>END IF<BR>However the LIKE command isn&#039t working. How can I find a single value in a field?

  2. #2
    Join Date
    Dec 1969

    Default RE: Using LIKE Statement

    The VBScript subset does not contain the LIKE operator :(<BR><BR>For your purposes try:<BR><BR>IF INSTR(1,MBID,VERID) &#062; 0 THEN<BR>MBPRICE = "0"<BR>END IF<BR><BR>hope this helps.<BR>

  3. #3
    Jimmy Wang Guest

    Default RE: Using LIKE Statement

    Keyword "Like" is used by building SQL Statement.<BR>Here is code I think will work for you if I totally understood your question<BR><BR>&#060;% Call FindMyDigit (MBID,VERID) %&#062;<BR>&#060;%<BR>Sub FindMyDigit (MBID,VERID)<BR>allDigits=Split(MBID,",")<BR>For i=0 to uBound(allDigits)<BR>If allDigits(i)=VERID Then<BR>MBPRICE = "0"<BR>Exit Sub<BR>End If<BR>Next<BR>End Sub<BR>%&#062;<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts