By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,896 Members | 1,997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,896 IT Pros & Developers. It's quick & easy.

criteria specifications

P: 4
I have a several rows say
Location part # product code
105 E05 DX
104 1740 DX
104 2047 DX

I want a way to find a way in chriteria thet i can find all related info on these parts.
When i ran this query it only gave me the product code DX
I know you can use wild cards in queries but this is to specific and i would need all info related to the seperate part numbers if they were expanded.
is there a way to set chriteria to find all related numbers of my list using the first 3 characters, so it will give me any other part number product code that even contain say E05.

have a several rows say
Location part # product code
105 E05 DX
106 E055 RX
104 1740 DX
105 1740-567 FX
104 2047 DX
Dec 4 '08 #1
Share this Question
Share on Google+
6 Replies

Expert 100+
P: 1,287
You can use the LIKE condition. See examples here:
SQL: LIKE Condition

If you want to match 4 different sets of numbers like that I think you could do
WHERE id LIKE '12345%' OR id LIKE '16564% or id LIKE etc.
Dec 4 '08 #2

P: 4
Ya that works the only thing is i have say 800 rows.

Is there a way to use the like for the characters in the feild with out being so specific

select *
FROM Part #
WHERE Part # LIKE ' ( say the first 4 character)

Or something that could be applied to the whole table without going throught each number?
Dec 4 '08 #3

Expert 100+
P: 1,287
I don't understand the question. That's exactly what LIKE '1234%' does. The select is going to have to look at the part number of each record in the table regardless.
Dec 4 '08 #4

Expert 2.5K+
P: 2,653
Hello, Cody.

You could try join the datasets on partial match.
Expand|Select|Wrap|Line Numbers
  1. SELECT [AllRecords].* FROM [AllRecords] INNER JOIN [SeveralRows] ON [AllRecords].[part #] Like '*' & [SeveralRows].[part #] & '*';
Dec 4 '08 #5

P: 4
ya i understand that but i want the like'12345%' of all 800 part numbers... meaning.....

If i have all of the part numbers below i want the like'E05%', and the like'1740%' and the like'2047%' and so on and so on for all 800 part numbers.

Dec 4 '08 #6

P: 4
thanks fishval ill try that!
Dec 4 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.