VBA Query to look for a string within a field

T

taxidermist

I have a field in a table that has a four digit number located in the
DESCRIPTION field. It is not the only data in the field and is not
always at the front or end of the field. I need a query that will get
the SC_DATE and WO_NUMBER from tbCONTRACT where a specific 4-digit
number is located within the DESCRIPTION field.

EXAMPLE:

WO_NUMBER SC_DATE DESCRIPTION
522834 01/17/2008 STRUCTURAL ASSEMBLY FOR I.B. 2210
PER CO
723499 04/03/2008 225 PANEL LINE FOR DK W/SHELL 2220
374632 02/17/2008 ERECT GB 2230 (2210,2220 & 2230)
PRE SHIP ASSY
234878 08/20/2008 PRE-OUTFIT 400 W/S DK W/SHELL 2130

I need a query that would look for 2220 in the DESCRIPTION field and
give me a result that contains
723499 04/03/2008
374632 02/17/2008
 
F

fredg

I have a field in a table that has a four digit number located in the
DESCRIPTION field. It is not the only data in the field and is not
always at the front or end of the field. I need a query that will get
the SC_DATE and WO_NUMBER from tbCONTRACT where a specific 4-digit
number is located within the DESCRIPTION field.

EXAMPLE:

WO_NUMBER SC_DATE DESCRIPTION
522834 01/17/2008 STRUCTURAL ASSEMBLY FOR I.B. 2210
PER CO
723499 04/03/2008 225 PANEL LINE FOR DK W/SHELL 2220
374632 02/17/2008 ERECT GB 2230 (2210,2220 & 2230)
PRE SHIP ASSY
234878 08/20/2008 PRE-OUTFIT 400 W/S DK W/SHELL 2130

I need a query that would look for 2220 in the DESCRIPTION field and
give me a result that contains
723499 04/03/2008
374632 02/17/2008

Create a new query.

Select TbContract.WO_NUMBER, TbContract.SC_DATE from TbContract
Where TbContract.Description Like "*" & [Look for What?] & "*"

You will be prompted to enter the search value.
 
T

taxidermist

I have a field in a table that has a four digit number located in the
DESCRIPTION field. It is not the only data in the field and is not
always at the front or end of the field. I need a query that will get
the SC_DATE and WO_NUMBER from tbCONTRACT where a specific 4-digit
number is located within the DESCRIPTION field.

WO_NUMBER SC_DATE DESCRIPTION
522834 01/17/2008 STRUCTURAL ASSEMBLY FOR I.B. 2210
PER CO
723499 04/03/2008 225 PANEL LINE FOR DK W/SHELL 2220
374632 02/17/2008 ERECT GB 2230 (2210,2220 & 2230)
PRE SHIP ASSY
234878 08/20/2008 PRE-OUTFIT 400 W/S DK W/SHELL 2130
I need a query that would look for 2220 in the DESCRIPTION field and
give me a result that contains
723499 04/03/2008
374632 02/17/2008

Create a new query.

Select TbContract.WO_NUMBER, TbContract.SC_DATE from TbContract
Where TbContract.Description Like "*" & [Look for What?] & "*"

You will be prompted to enter the search value.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -

- Show quoted text -

I wish it was that simple. When I try that query I get no results.
 

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