Instr & SELECT ??

Results 1 to 2 of 2

Thread: Instr & SELECT ??

  1. #1
    Join Date
    Dec 1969

    Default Instr & SELECT ??

    Is it possible, somehow, to write a SELECT statement using Instr?<BR><BR>For example, I need to SELECT all products from a table WHERE the PRODNAME contains the word "grape".<BR><BR>In the PRODNAME field, it could have "grape juice" etc.<BR><BR>Help! TIA

  2. #2
    Join Date
    Dec 1969

    Default Use LIKE instead...

    SELECT * FROM table WHERE PRODNAME LIKE &#039;%grape%&#039;<BR><BR>Look in any decent SQL tutorial for help with LIKE.<BR><BR>The % marks work just like * in DOS directory listings: <BR><BR>%abc% will match abc any place: abc, abcdefg, xyzabc, xyzabcdefg<BR>abc% will match abc at beginning only: abc, abcdefg<BR>%abc will match abc at end only: xyzabc<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