473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Nov 12 '05 #1
1 10925
On 20 Nov 2003 14:42:27 -0800, rb*******@compuserve.com (Rick Brown)
wrote:
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>


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

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Adam Short | last post by:
I've never needed it before but now I do! Does anyone know if you are able to perform a NOT Like search using Classic ASP ADO? i.e. myData.Filter = "Ref NOT LIKE '*1234*'" by the way this...
2
by: Dave Smithz | last post by:
Hello there, Summary: How far can you go with SQL Select queries using like clauses with wildcard characters. Can you apply anything like regular expressions? Full details: On a Intranet...
9
by: Peter | last post by:
My problem is the last bit of coding below, the like statement does not work. what I have is a product options field and in it is stored characters i.e. "avcy" etc what the query does is...
2
by: Big John | last post by:
in Access 2003 I am trying to get sql query to run using a field as input, but I want to input into the field a value that uses the "like" operator to find any value that starts with the value...
1
by: Craig Kenisston | last post by:
Hi, I need to write a function that should behave like the SQL's "like" operator on a list of words. I was wondering if I can use Regex directly to do this job. But I've been reading about...
1
by: Linda | last post by:
Hi, Is there a way to do a "text" (rather than "binary") compareison with the "like" operator, without changing the global "Option Compare" setting? I don't want to risk breaking many, many...
2
by: swingingming | last post by:
Hi, When I am playing around with options, I came across with enabling "SQL server compatible syntax". After I enable this, I could not get one of my query to run. Can anyone explain the subtle...
2
by: vag | last post by:
This is going to be easy for any of you who is experienced. What is wrong with the following query? Select Company from Generalview Where Company Like '%'@search'%'
4
by: teddysnips | last post by:
I am just getting to grips with LINQ to SQL and my first attempt is to create a Search form. I need the LINQ to generate SQL like this: SELECT * FROM CustomerTable WHERE Surname LIKE 'S%' ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.