Please, help with Select query

  • Thread starter Thread starter Sergio
  • Start date Start date
S

Sergio

Hi,

Could someone help me, please. I am new in Access programming.
I have the following query

SELECT MP06.TER, MP06.MEST
FROM MP06
WHERE (((MP06.TER) Like "11*") AND ((MP06.MEST) Not Like "11*") or
((MP06.TER) Like "15*") AND ((MP06.MEST) Not Like "15*") or ((MP06.TER)
Like "19*") AND ((MP06.MEST) Not Like "19*") );

But in fact those numbers 11, 15, 19 etc I need to take from a table AREA.
There are much more of those numbers.
Is there a way to do it?
Thanks in advance.

Sergei
 
There are much more of those numbers.
But you are treating them as though they were text when you use Like "11*".
What is the field's datatype?
If they are text you can put them in a table - Check with field Check and
then this query (Untested) --
SELECT MP06.TER, MP06.MEST
FROM MP06, [Check]
WHERE MP06.TER Like [Check].[Check]&"*" AND MP06.MEST Not Like
[Check].[Check]&"*" ;
 
Back
Top