Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select single character from within value of single table field? 1

Status
Not open for further replies.

Turb

Technical User
Feb 11, 2003
154
US
All,
I have a table that has a field where the values are entered as "##-?###" (ie 05-C155). The letter character is a designate for an area of the production floor here; there are five different areas represented, C, M, S, I, and R.
Is there any way to create a query that would allow a user to select the query output by choosing a specific area from a list?
For example, say I want to see all the records for the C area only?
Any help is appreciated!
 
A starting point (SQL code snippet):
WHERE yourField Like '*C*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,
Thank you for responding.
Could this code snippet could be used with a combobox on a form or something similar?
The users would have to select the letter from a list (or alternately, enter it themselves in a form text box) to filter the query results. They would not have access to change the query structure.
Wouldn't I have to make five different queries using this type of code, one for each area?
 
WHERE [yourtable].[yourfield]) Like "*" & [forms]![yourform]![yourcombobox] & "*
 
cranebill,
Works like a charm!
Star for you!
Thank you!

Thank you both!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top