473,386 Members | 1,758 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,386 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 1471
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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.