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

Wildcards with Like in Microsoft Access

Hi all,

I'm trying a very simple Like statement in MS Access XP, but it's
acting strange. I've always used a percent (%) for wildcards in MS
SQL, and I thought this was the same in MS Access... but I'm finding I
must use an astrisk (*) instead.

Example, with the following layout for Accounts table:
Text AcctNumber (Primary Key)
Text FirstName
Text LastName
Date AdmitDate
Number AmountDue

I use the following statement:
select * from Accounts where lastname like '%th'
.... it returns nothing, but the following statement
select * from Accounts where lastname like '*th'
Does work, returning Smith and others that end in 'th'.

So, in MS Access is a wildcard * instead of % ??? Just checking.

Thanks,

Alex.
Nov 12 '05 #1
2 3811
On 1 Apr 2004 08:48:54 -0800, Alex wrote:
Hi all,

I'm trying a very simple Like statement in MS Access XP, but it's
acting strange. I've always used a percent (%) for wildcards in MS
SQL, and I thought this was the same in MS Access... but I'm finding I
must use an astrisk (*) instead.

Example, with the following layout for Accounts table:
Text AcctNumber (Primary Key)
Text FirstName
Text LastName
Date AdmitDate
Number AmountDue

I use the following statement:
select * from Accounts where lastname like '%th'
... it returns nothing, but the following statement
select * from Accounts where lastname like '*th'
Does work, returning Smith and others that end in 'th'.

So, in MS Access is a wildcard * instead of % ??? Just checking.

Thanks,

Alex.


Yup.
Like "*" & [Enter search word] & "*"
will prompt for, and find all words with the entered word any where in
the field.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2
"fredg" <fg******@example.invalid> wrote in message
news:8p***************************@40tude.net...
On 1 Apr 2004 08:48:54 -0800, Alex wrote:
So, in MS Access is a wildcard * instead of % ??? Just checking.


Yup.
Like "*" & [Enter search word] & "*"
will prompt for, and find all words with the entered word any where in
the field.


Unless you're using ADO, in which case it's %...

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

Nov 12 '05 #3

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

Similar topics

6
by: Bharath Dhurjati | last post by:
Hello, I am looking for documentation that specifies the following behavior exhibited by java. The following (assuming MyClass.class is accessible and has a main()) java MyClass * yields...
3
by: sashi | last post by:
Hi, Is it possible to use wildards in SQL to drop a constraint on a table? Thanks!
2
by: Alex | last post by:
Hi all, I'm trying a very simple Like statement in MS Access XP, but it's acting strange. I've always used a percent (%) for wildcards in MS SQL, and I thought this was the same in MS Access......
0
by: DotNetJunkies User | last post by:
I have data in my DataTable that lists multiple values in the Roles column which are space separated like this: " AM AMB MCS DIO CO PM3 CAM " I need to be able to query on this column to get back...
2
by: Dennis | last post by:
I am trying to implement a "Find and Replace" dialog that allows using wildcards in the find string, much like the Find and Replace Dialogs in Ms Word, etc. Are there any references or examples on...
1
by: Anandan | last post by:
Hi, This is regarding Dataset Filter: WILDCARD CHARACTERS Both the * and % can be used interchangeably for wildcards in a LIKE comparison. If the string in a LIKE clause contains a * or %,...
2
by: john | last post by:
In a query I have put the following criteria in a field: Now I would like the query to use this user input to search with wildcards. So, if he enters john, in fact the query should search like:...
19
by: Alan Carpenter | last post by:
Access 8 on Win98 and WinXP I'm having trouble with wildcards in the .Filename property of the FileSearch Object giving different results on win98 and XP. I've been successfully using...
3
by: keri | last post by:
Hi, (back again!) I have searched topics but not found the answer so wondered if anyone can put me out of my misery. I have a filter on a subform based on what is typed in a textbox. I want...
5
by: nidaar | last post by:
From a security point of view, is accepting wildcards like "%" in input parameters of stored procedures against any best practices? As an example, if a user defined function uses "Productname...
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: 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
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...
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...
0
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...
0
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...

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.