How do I get a querie to match part of a field in Access 2000?

G

Guest

I have a database that stores information about parts that have been ticketed
as defective. I need to make a query that will allow me to generate a report
using the following criteria:
1- a beginning and ending date range
2- a partial part number

I have the date range down, but I cannot get my query to search by partial
field in part numbers. For example, I have part numbers 123A4567RK and
123A4567SF. I want to be able to type in the center part of the number
(4567) and come up with all of the RK and SF numbers that are defective.

Any help would be great.
 
M

Marshall Barton

Ittie06 said:
I have a database that stores information about parts that have been ticketed
as defective. I need to make a query that will allow me to generate a report
using the following criteria:
1- a beginning and ending date range
2- a partial part number

I have the date range down, but I cannot get my query to search by partial
field in part numbers. For example, I have part numbers 123A4567RK and
123A4567SF. I want to be able to type in the center part of the number
(4567) and come up with all of the RK and SF numbers that are defective.


You should be more specific.

You can match on any part of a field by using:

Like "*4567*"

But, if it must end in RK or SF, then you'll need:

Like "*4567RK" OR Like "*4567SF"
 
J

John Spencer

Field: PartNumber
Criteria: LIKE "*" & [What Part?] & "*"

That will match any part number that contains what you type in for What
Part?
If you want parts that start with what you have entered then change the
criteria to
Criteria: LIKE [What Part?] & "*"

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

I tried typing in this:
Like"*"&[Enter Part Number]&"*"
and that didn't work. I then tried:
Like"*[Enter Part Number]*"
and that didn't work either. :(

I want to be able to type in a partial part number (6561 instead of
164D6561P001) and find the entries for a specified date range. We always use
the senter four numbers, so I know that an asterisk will be on each side of
the criteria, but I can't understand why it will not work...

I am typing the criteria in the blank below the part number field, so that
can't be my problem. I know there are at least 15 records for the date
period I am typing in, but nothing shows up with either string I used above.
 
G

Guest

I just got it fixed, and it works perfectly! I used:
Like"*"&[Enter Part Number]&"*"
for my criteria and make a quickie scan of the fields and saw one that was
labeled "*" with criteria typed into it. I deleted the criteria there and
now the query runs like a charm. :) Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top