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

Queries and Like

Hello,

I currently have a query that takes it's criteria from a form. All works
well except when a name is mis-spelled in the database. My thought was to
try to use the "like" command as part of the critera. My problem is that
when I use it, it finds no records. Need a little help please.

TIA
Steve
Nov 12 '05 #1
5 1472
Steve,

You also want to use wildcards. A '?' represents any 1 character and a '*'
represents one or more characters. They are used like this:

Like "?" & "at" returns cat. eat, fat, hat, mat, ....
Note that the expression only returns 3-letter words because '?' represents
only 1 character!

Like "*" & "at" cat, eat, fat, hat, mat, meat, what, ....
Note that the expression here requires the words to end in 'at' but there
can be any number of letters in front of 'at'

Wildcards can also be used in the middle of an expression or at the end.

Like "s" & "?" & "ar" will return scar, star, ...
Like "s" & "*" & "ar" will return all words beginning with 's' and ending with
'ar'

Like "m" & "?" will return all two-letter words beginning with 'm', ma, me, mi
Like "m" & "*" will return all words begimming with 'm'
to contrast, me will be returmed as well as Massachusetts and Mississippi

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Steve" <st***@work.com> wrote in message news:c5**********@news.netins.net...
Hello,

I currently have a query that takes it's criteria from a form. All works
well except when a name is mis-spelled in the database. My thought was to
try to use the "like" command as part of the critera. My problem is that
when I use it, it finds no records. Need a little help please.

TIA
Steve

Nov 12 '05 #2
I tried the following criteria, Like [forms]![lookup]!["Last" & "*"], with
no luck. Is it even possible use like in this context or am I chasing my
tail? The information was helpful to me for the future, thank you.

Steve
"PC Datasheet" <sp**@nospam.spam> wrote in message
news:j2*****************@newsread3.news.atl.earthl ink.net...
Steve,

You also want to use wildcards. A '?' represents any 1 character and a '*'
represents one or more characters. They are used like this:

Like "?" & "at" returns cat. eat, fat, hat, mat, ....
Note that the expression only returns 3-letter words because '?' represents only 1 character!

Like "*" & "at" cat, eat, fat, hat, mat, meat, what, ....
Note that the expression here requires the words to end in 'at' but there can be any number of letters in front of 'at'

Wildcards can also be used in the middle of an expression or at the end.

Like "s" & "?" & "ar" will return scar, star, ...
Like "s" & "*" & "ar" will return all words beginning with 's' and ending with 'ar'

Like "m" & "?" will return all two-letter words beginning with 'm', ma, me, mi Like "m" & "*" will return all words begimming with 'm'
to contrast, me will be returmed as well as Massachusetts and Mississippi

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Steve" <st***@work.com> wrote in message

news:c5**********@news.netins.net...
Hello,

I currently have a query that takes it's criteria from a form. All works well except when a name is mis-spelled in the database. My thought was to try to use the "like" command as part of the critera. My problem is that
when I use it, it finds no records. Need a little help please.

TIA
Steve


Nov 12 '05 #3
I got it figured out. Thank you very much for the help. Your information
gave me a direction.

Steve

"Steve" <st***@work.com> wrote in message
news:c5**********@news.netins.net...
I tried the following criteria, Like [forms]![lookup]!["Last" & "*"], with
no luck. Is it even possible use like in this context or am I chasing my
tail? The information was helpful to me for the future, thank you.

Steve
"PC Datasheet" <sp**@nospam.spam> wrote in message
news:j2*****************@newsread3.news.atl.earthl ink.net...
Steve,

You also want to use wildcards. A '?' represents any 1 character and a '*'
represents one or more characters. They are used like this:

Like "?" & "at" returns cat. eat, fat, hat, mat, ....
Note that the expression only returns 3-letter words because '?' represents
only 1 character!

Like "*" & "at" cat, eat, fat, hat, mat, meat, what, ....
Note that the expression here requires the words to end in 'at' but

there
can be any number of letters in front of 'at'

Wildcards can also be used in the middle of an expression or at the end.

Like "s" & "?" & "ar" will return scar, star, ...
Like "s" & "*" & "ar" will return all words beginning with 's' and ending with
'ar'

Like "m" & "?" will return all two-letter words beginning with 'm', ma,

me, mi
Like "m" & "*" will return all words begimming with 'm'
to contrast, me will be returmed as well as Massachusetts and

Mississippi
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Steve" <st***@work.com> wrote in message

news:c5**********@news.netins.net... Hello,

I currently have a query that takes it's criteria from a form. All works well except when a name is mis-spelled in the database. My thought was to try to use the "like" command as part of the critera. My problem is that when I use it, it finds no records. Need a little help please.

TIA
Steve



Nov 12 '05 #4

"Steve" <st***@work.com> wrote in message news:c5**********@news.netins.net...
I tried the following criteria, Like [forms]![lookup]!["Last" & "*"], with
no luck. Is it even possible use like in this context or am I chasing my
tail? The information was helpful to me for the future, thank you.

Steve
"PC Datasheet" <sp**@nospam.spam> wrote in message
news:j2*****************@newsread3.news.atl.earthl ink.net...
Steve,

You also want to use wildcards. A '?' represents any 1 character and a '*'
represents one or more characters. They are used like this:

Like "?" & "at" returns cat. eat, fat, hat, mat, ....
Note that the expression only returns 3-letter words because '?'

represents
only 1 character!

Like "*" & "at" cat, eat, fat, hat, mat, meat, what, ....
Note that the expression here requires the words to end in 'at' but

there
can be any number of letters in front of 'at'

Wildcards can also be used in the middle of an expression or at the end.

Like "s" & "?" & "ar" will return scar, star, ...
Like "s" & "*" & "ar" will return all words beginning with 's' and ending

with
'ar'

Like "m" & "?" will return all two-letter words beginning with 'm', ma,

me, mi
Like "m" & "*" will return all words begimming with 'm'
to contrast, me will be returmed as well as Massachusetts and Mississippi

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Steve" <st***@work.com> wrote in message

news:c5**********@news.netins.net...
Hello,

I currently have a query that takes it's criteria from a form. All works well except when a name is mis-spelled in the database. My thought was to try to use the "like" command as part of the critera. My problem is that
when I use it, it finds no records. Need a little help please.

TIA
Steve



Nov 12 '05 #5
Steve,

Your syntax is incorrect!

Try:

Like [forms]![lookup]![Last] & "*"

Steve
PC Datasheet
"Steve" <st***@work.com> wrote in message news:c5**********@news.netins.net...
I tried the following criteria, Like [forms]![lookup]!["Last" & "*"], with
no luck. Is it even possible use like in this context or am I chasing my
tail? The information was helpful to me for the future, thank you.

Steve
"PC Datasheet" <sp**@nospam.spam> wrote in message
news:j2*****************@newsread3.news.atl.earthl ink.net...
Steve,

You also want to use wildcards. A '?' represents any 1 character and a '*'
represents one or more characters. They are used like this:

Like "?" & "at" returns cat. eat, fat, hat, mat, ....
Note that the expression only returns 3-letter words because '?'

represents
only 1 character!

Like "*" & "at" cat, eat, fat, hat, mat, meat, what, ....
Note that the expression here requires the words to end in 'at' but

there
can be any number of letters in front of 'at'

Wildcards can also be used in the middle of an expression or at the end.

Like "s" & "?" & "ar" will return scar, star, ...
Like "s" & "*" & "ar" will return all words beginning with 's' and ending

with
'ar'

Like "m" & "?" will return all two-letter words beginning with 'm', ma,

me, mi
Like "m" & "*" will return all words begimming with 'm'
to contrast, me will be returmed as well as Massachusetts and Mississippi

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Steve" <st***@work.com> wrote in message

news:c5**********@news.netins.net...
Hello,

I currently have a query that takes it's criteria from a form. All works well except when a name is mis-spelled in the database. My thought was to try to use the "like" command as part of the critera. My problem is that
when I use it, it finds no records. Need a little help please.

TIA
Steve



Nov 12 '05 #6

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

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
5
by: WertmanTheMad | last post by:
Ive been playing with this for a few days and thought I might thow it out for seggestions. I have Several Queries that need counts returned The Queries are Mutually Exclusive meaning whatever...
9
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my...
5
by: Jerry Hull | last post by:
I'm working with a database developed by an untrained person over several years - and on a network that has recently been upgraded with a new server installed and MS office upgraded from 2K (I...
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
44
by: Greg Strong | last post by:
Hello All, Is it better to create a query in DAO where a report has 4 sub-reports each of whose record source is a query created at runtime and everything is in 1 MDB file? From what I've...
4
by: Mikael Janers | last post by:
Hello! I have a question that is not realy only C# but I didn't find any better group... What is the most common/best way to handle sql queries in C# 1) Should I use stored procedures ? I...
9
by: Scott Ribe | last post by:
OK, I'm using a pool of worker threads that each have a connection (from my own software, no PHP or anything like that involved), and a connection is in a state where all queries fail. Looking back...
1
by: loosecannon_1 | last post by:
Hello everyone, I am hoping someone can help me with this problem. I will say up front that I am not a SQL Server DBA, I am a developer. I have an application that sends about 25 simultaneous...
14
by: google | last post by:
I am creating a new database for use within our company, that I'd like to make reasonably secure (short of a true server based solution). The back-end of a non-server based database seems to be...
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
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
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
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.