Connecting Tech Pros Worldwide Help | Site Map

Proper "LIKE" Syntax

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 03:43 PM
Rick Brown
Guest
 
Posts: n/a
Default Proper "LIKE" Syntax

I'm trying to scan a barcode that contains the text string
"BPWOT08762" into a textbox for use in a DLookup or query grid.

I want to look thru a table's field that contains the last 6
characters of the barcode plus a 1 character prefix.


Test Data in table:

SerialNumber
MP40789
MP39718
S583424
MT08762 <<<<<<<<<<<<<<
S581724
MP39048
MP37338
S583199
MP37584


I want to return the seven character serial number(MT08762) from the
table.

The return will be used in a Labels textbox.

I've tried to do this in a query grid but can't get the syntax right.

Failed attempt follows: Like '*" &
right([Forms]![Form1]![SerialNumber],6) & "'

I can code if required.(sort of)<g>

TIA, Rick

  #2  
Old November 12th, 2005, 03:43 PM
Jim Allensworth
Guest
 
Posts: n/a
Default Re: Proper "LIKE" Syntax

On 20 Nov 2003 14:42:27 -0800, rbrowniii@compuserve.com (Rick Brown)
wrote:
[color=blue]
>I'm trying to scan a barcode that contains the text string
>"BPWOT08762" into a textbox for use in a DLookup or query grid.
>
>I want to look thru a table's field that contains the last 6
>characters of the barcode plus a 1 character prefix.
>
>
>Test Data in table:
>
>SerialNumber
>MP40789
>MP39718
>S583424
>MT08762 <<<<<<<<<<<<<<
>S581724
>MP39048
>MP37338
>S583199
>MP37584
>
>
>I want to return the seven character serial number(MT08762) from the
>table.
>
>The return will be used in a Labels textbox.
>
>I've tried to do this in a query grid but can't get the syntax right.
>
>Failed attempt follows: Like '*" &
>right([Forms]![Form1]![SerialNumber],6) & "'
>
>I can code if required.(sort of)<g>
>[/color]

It looks like you have a mix of single and double quotes: Try...
Like "*" & right([Forms]![Form1]![SerialNumber],6)


- Jim

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.