473,379 Members | 1,377 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,379 software developers and data experts.

Access 2002 and LIKE

Forgive me if this has been discussed before, but i didn't find anything
that matched at google groups...

I am having a problem selecting records using LIKE and wildcards. I have
a field named "Code" that has values like:
"A"
"A, H"
"C, M, A"
"H, M"

In the query design view, I have the Criteria of the "Code" column as:
Like "*" & [Search Code:] & "*"

So when I run the query, I am propted for the search code, which works
fine. However, the only records selected are the ones that have "A" as
the code. I had expected all records containing "A" in the field,
selecting all above examples except "H, M".

Can someone please tell me what I am missing here?

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Nov 12 '05 #1
4 9043
I just tried this and it works as you say you would expect it to. Can you
post the SQL of the query?

--
Wayne Morgan
Microsoft Access MVP
"Justin Koivisto" <sp**@koivi.com> wrote in message
news:a5*****************@news7.onvoy.net...
Forgive me if this has been discussed before, but i didn't find anything
that matched at google groups...

I am having a problem selecting records using LIKE and wildcards. I have
a field named "Code" that has values like:
"A"
"A, H"
"C, M, A"
"H, M"

In the query design view, I have the Criteria of the "Code" column as:
Like "*" & [Search Code:] & "*"

So when I run the query, I am propted for the search code, which works
fine. However, the only records selected are the ones that have "A" as
the code. I had expected all records containing "A" in the field,
selecting all above examples except "H, M".

Can someone please tell me what I am missing here?

Nov 12 '05 #2
In 2002, I think you can't use * at the beginning of the LIKE argument.
If you do, the wildcard is ignored. Take a look in the Help file.

Pavel

Justin Koivisto wrote:

Forgive me if this has been discussed before, but i didn't find anything
that matched at google groups...

I am having a problem selecting records using LIKE and wildcards. I have
a field named "Code" that has values like:
"A"
"A, H"
"C, M, A"
"H, M"

In the query design view, I have the Criteria of the "Code" column as:
Like "*" & [Search Code:] & "*"

So when I run the query, I am propted for the search code, which works
fine. However, the only records selected are the ones that have "A" as
the code. I had expected all records containing "A" in the field,
selecting all above examples except "H, M".

Can someone please tell me what I am missing here?

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Nov 12 '05 #3
Wayne Morgan wrote:
I just tried this and it works as you say you would expect it to. Can you
post the SQL of the query?


I found the problem. The query was working correctly, but the data for
the record that was missing was corrupt. I imported the data from the
CSV file again, and it's all working as expected... Sorry.

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Nov 12 '05 #4
Pavel Romashkin wrote:
Justin Koivisto wrote:
Forgive me if this has been discussed before, but i didn't find anything
that matched at google groups...

I am having a problem selecting records using LIKE and wildcards. I have
a field named "Code" that has values like:
"A"
"A, H"
"C, M, A"
"H, M"

In the query design view, I have the Criteria of the "Code" column as:
Like "*" & [Search Code:] & "*"

So when I run the query, I am propted for the search code, which works
fine. However, the only records selected are the ones that have "A" as
the code. I had expected all records containing "A" in the field,
selecting all above examples except "H, M".

Can someone please tell me what I am missing here?
In 2002, I think you can't use * at the beginning of the LIKE argument.
If you do, the wildcard is ignored. Take a look in the Help file.

Pavel


That's incorrect, using the Like "*" & [Search Code:] & "*" syntax, I am
getting the results I had expected. For instance, if I enter M as the
search code, I do get the two records as an example above. Also, in the
help file under a subhead of "Part of a field's value (Like)" it does
show a table where the expression used is Like "*Imports" and the result
is stated as "For a ShipName field, orders shipped to customers whose
names end with the word "Imports" (ANSI-89)".

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Nov 12 '05 #5

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

Similar topics

20
by: John | last post by:
Hi, I've recently upgraded from Access 97 to Access 2002 & the performance basically stinks. I have tried the following items listed below but it has only had a minor impact: 1) Upgraded Jet...
13
by: Noesis Strategy | last post by:
When I ordered my new laptop, Sony didn't offer Access 2003 in its bundles. Recently, I have begun to design Access databases using an copy of Access 2002 from my previous laptop. It works fine,...
3
by: Scott | last post by:
Hi, If we want to compile an Access 2002 database and distribute it to others, will the compiled software run on any PC, like Windows 98, Windows 2000, etc. Also, you don't have to have...
3
by: Colin Chudyk | last post by:
Hi, Here is my situation. Can anyone provide insight? I have developed a database in Access 2002. I am planning to distribute it as a split MDE (front) / MDB (back) to be used by the Access...
3
by: Stickleback | last post by:
Morning All I have been developing and deploying with Office 2000 for about 3 years, mainly Access based programs and although I have gotten used to it's quirks, I am starting to feel that I...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
2
by: Bruce Dodds | last post by:
I will be doing an app for a nonprofit. It would be useful for them to have a good entry-level book on Access so that they don't have to pay someone to design all their queries and reports. I'm not...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
3
by: banba_ca | last post by:
When I create a new db from the main Access window or thru Vb (set newdb = ...) I always end up with Access 2000 file format. I would like to get 2002 - 2003 file format. The reason is that when I...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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...

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.