473,473 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

query criteria with wildcard

I've searched around about this issue I'm having, but it's not been too
successful.
My problem is this:
I have a query where a user is prompted for the criteria e.g. [Enter info:],
but that info can get complicated and long, and as we all know, the criteria
has to be exactly as it is in the source table (except for letter case) in
order to get the results you want. Is there a way for the user to enter a
section of the wanted results, either like "abcd*" or "*cdef" or even
"*cde*" and it gives all the records that have the entered string somewhere
in the field of each record.
I hope I'm making sense. Thanks for the help.
Nov 13 '05 #1
2 1775
On Mon, 26 Jul 2004 23:10:01 +0100, d.p. wrote:
I've searched around about this issue I'm having, but it's not been too
successful.
My problem is this:
I have a query where a user is prompted for the criteria e.g. [Enter info:],
but that info can get complicated and long, and as we all know, the criteria
has to be exactly as it is in the source table (except for letter case) in
order to get the results you want. Is there a way for the user to enter a
section of the wanted results, either like "abcd*" or "*cdef" or even
"*cde*" and it gives all the records that have the entered string somewhere
in the field of each record.
I hope I'm making sense. Thanks for the help.


Use Like.

To return records with the word anywhere in the field:
Like "*" & [Enter info] & "*"

To return records with the word at the beginning of the field:
Like "*" & [Enter info]

To return records with the word at the end of the field:
Like [Enter info] & "*"
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2
excellent! such simple things...and I go blank!
thanks so much!
"fredg" <fg******@example.invalid> wrote in message
news:19*****************************@40tude.net...
On Mon, 26 Jul 2004 23:10:01 +0100, d.p. wrote:
I've searched around about this issue I'm having, but it's not been too
successful.
My problem is this:
I have a query where a user is prompted for the criteria e.g. [Enter info:], but that info can get complicated and long, and as we all know, the criteria has to be exactly as it is in the source table (except for letter case) in order to get the results you want. Is there a way for the user to enter a section of the wanted results, either like "abcd*" or "*cdef" or even
"*cde*" and it gives all the records that have the entered string somewhere in the field of each record.
I hope I'm making sense. Thanks for the help.


Use Like.

To return records with the word anywhere in the field:
Like "*" & [Enter info] & "*"

To return records with the word at the beginning of the field:
Like "*" & [Enter info]

To return records with the word at the end of the field:
Like [Enter info] & "*"
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Nov 13 '05 #3

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

Similar topics

8
by: Lumpierbritches | last post by:
Thank you in advance for any and all assistance, it is GREATLY appreciated. I was wondering if there is a way, with code to create a query for every table? Or can you use a naming convention in...
6
by: Andy | last post by:
Hello, I am having many problems with setting up a parameter query that searches by the criteria entered or returns all records if nothing is entered. I have designed an unbound form with 3...
4
by: Lightning Tony | last post by:
This is probably a really silly question but I am exhausted and cant seem to find the answer. I have a query that I run from a command button on a form. The query has three criteria set. The first...
3
by: dnl | last post by:
I have a parameter query that I would like to simplify so that I wouldn't need to use wildcards when entering in partial data. The following line is in the criteria field when designing the query:...
11
by: DP | last post by:
hi, i have a films table and form. i have a txt field in teh form called txtSearch , and i;ve created a query with all the film table fields in it. how can i get the query to load up, wth the...
2
by: David Mitchell | last post by:
I need to have a form which will display all products (from tblproducts) and their stock level (sum of product received from tblacqdetail, minus sum of product sold from tblinvdetail) in a...
11
by: Bruce Lawrence | last post by:
Ok, I'm baffled... I'm making a query in access 97 between 2 tables. There is a field in both tables called "DWGNO". OPENORD has a record with a DWGNO of "00000012345" DIEDATA has a record...
2
by: starke1120 | last post by:
I have a main form with a text box on it "txtSearch" onlost focus it updates another text box "txtSearchString" to include a quote and asterik before and after the value of txtSeach. I then...
5
by: DeanL | last post by:
Hi all, I'm trying to set up a query that runs from a command button on a form (simple enough so far), what I want the query to do is take values from the fields on the form (seven fields in...
2
by: jball | last post by:
Hi guys, I have a simple questions I think. I have a report based on a query. The query has an input box that says . If the number is exact, the report runs great. My question is how do I...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.