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

Why doesn't Like work??

I am trying to do a simple query to find records that contain keywords

SELECT tblKeywords.KeyWord, tblKeywords.Code
FROM tblKeywords
WHERE (((tblKeywords.KeyWord) Like '%HOSE%'));

I know that there are several records with the word HOSE in them but the
query always returns nothing.

Example:

KeyWord Code
HOSE CLAMP 1234
HOSE VACUUM 3245
AIR HOSE 5546

I would expect all of these records to be returned with query shown???
Ron H.

Nov 12 '05 #1
4 1108
Shouldn't it be
Like '*HOSE*' ?
"Ron H." <ro************@mmm.com> wrote in message
news:c4**********@tuvok3.mmm.com...
I am trying to do a simple query to find records that contain keywords

SELECT tblKeywords.KeyWord, tblKeywords.Code
FROM tblKeywords
WHERE (((tblKeywords.KeyWord) Like '%HOSE%'));

I know that there are several records with the word HOSE in them but the
query always returns nothing.

Example:

KeyWord Code
HOSE CLAMP 1234
HOSE VACUUM 3245
AIR HOSE 5546

I would expect all of these records to be returned with query shown???
Ron H.

Nov 12 '05 #2
'*' is the wild card character in Access.

So your expression would need to be Where((tblKeywords.KeyWord) Like
'*HOSE*');

Cheers,
Peter
Nov 12 '05 #3
Thanks! I guess that was supposed to be intuitive? I was using the MS
SQLserver online SQL help and I guess Access is a subset that doesn't follow
the same standard.... what standard....
Ron H.
Nov 12 '05 #4
Access is not a "subset" of SQL Server. In fact, strictly speaking, _Access_
is the user interface and database developer tool, not actually a database:
the default database installed with and used by Access is Microsoft Jet
(formerly JET for Joint Engine Technology, but that was changed a few
releases ago). Access can also be used as a client application with a number
of server databases.

Jet has its own "dialect" of the SQL language, as does SQL Server, as does
Informix, as does Oracle... it's just that some of the server databases are
closer to the SQL approved by the standards bodies. But, you should expect
to run into difficulties if you use the help from any particular database
expecting it to be the authority for some other database.

I'm currently doing some work for a client company, on an Access ADP (aka
"project") with data in MS SQL Server. The query you show would have been
appropriate in that environment, because you use the SQL Server syntax ("%"
instead of "*"), rather than Access/Jet syntax.

Larry Linson
Microsoft Access MVP

"Ron H" <12****@attbi.com> wrote in message
news:dGjcc.195988$po.1013479@attbi_s52...
Thanks! I guess that was supposed to be intuitive? I was using the MS
SQLserver online SQL help and I guess Access is a subset that doesn't follow the same standard.... what standard....
Ron H.

Nov 12 '05 #5

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

Similar topics

7
by: AnnMarie | last post by:
My JavaScript Form Validation doesn't work at all in Netscape, but it works fine in IE. I made some of the suggested changes which enabled it to work in IE. I couldn't make all the changes...
39
by: Mark Johnson | last post by:
It doesn't seem possible. But would the following also seem a violation of the general notions behind css? You have a DIV, say asociated with class, 'topdiv'. Inside of that you have an anchor...
3
by: Matt | last post by:
I want to know if readOnly attribute doesn't work for drop down list? If I try disabled attribute, it works fine for drop down list. When I try text box, it works fine for both disabled and...
149
by: Christopher Benson-Manica | last post by:
(Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? --...
6
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType =...
4
by: bbp | last post by:
Hello, In an ASPX page I have a "Quit" button which make a simple redirect in code-behind. This button doesn't work no more since (I think) I moved from the framework 1.0 to 1.1 and it doesn't...
3
by: Dave Moore | last post by:
Hi All, Ok, here's my problem. I want to open a file and process its contents. However, because it is possible that the file may not exist, I also want to check whether the file() function is...
10
by: Sourcerer | last post by:
I wrote this very simple code in .NET VC++. I compiled it on my system, and tried to run it on my friend's computer (he doesn't have the compiler). We both have Windows XP Professional. I have .NET...
6
by: Johnny Jörgensen | last post by:
I've got a usercontrol derived from a normal ComboBox that contains some special formatting code. On my main form I've got a lot of my custom comboboxes. I discovered a bug in the derived...
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.