473,791 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10958
On 20 Nov 2003 14:42:27 -0800, rb*******@compu serve.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
5605
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 doesn't work!! and neither does myData.Filter = "Ref <> LIKE '*1234*'"
2
13363
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 website, I request a code from a user which is then compared with a code in an ADO access database.
9
4635
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 that if I type in any single character all the products that match the criteria should be displayed. So if I typed in an "a" I should get 3 returns (see below) Fields could look like this: product.options: bhw djhsa
2
5148
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 placed in the field. e.g if i place the text "ada" in the field i want all values with "ada???????" when the sql is run. I can do it in a query by placing the value in a like statement and it gives all variations , but i want the value to be a...
1
19853
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 regex and it supports very different characters and behaves different. So, I'm looking for an advise. I'd like to know if it is feasable or not, I mean, if dotnet Regex implementation could handle it.
1
3525
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 lines of functional code just to get one "like" operation to behave as I wish. I want to check whether a single-character string is (a letter or number, INCLUDING diacritical letters) or whether it is (something else.)
2
4203
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 difference with this? Elookup works like DLookup and I copied it from a very old topic: strCriteria = " LIKE '*" & txtCompanyName & "*'" If IsNull(ELookup("CustomerID", "tblCustomers", strCriteria)) Then Thank you. Ming
2
1829
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
17775
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%' My LINQ so far looks like this: var cons = from c in db.CustomerTable
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.