How shall I write my question????

  • Thread starter Thread starter Ann-Sofie Karlsson
  • Start date Start date
A

Ann-Sofie Karlsson

Hi
I'm trying to write a query that ignore records if the Type=1 and
left(Name,4)<>"MSys" or left(Name,4)<>"Usys", but In the result I get table
names that start with "Msys".
Here is my query in SQL

SELECT Name, Type FROM MSysObjects
WHERE (Left(Name,4)<>"MSys" AND Type=1) OR (Left(Name,4)<>"USys" AND
Type=1);

Please help
Fia
 
WHERE Left(Name,4) <> "MSys" AND Left(Name,4) <> "USys" AND Type = 1

Using your original expression, 'MSys' would fail the test on the left of
the 'OR' but pass the test on the right of the 'OR', while 'USys' would fail
the test on the right of the 'OR', but pass the test on the left.
 
Fia,

Try the following:

SELECT Name, Type FROM MSysObjects
WHERE Left(Name,4) NOT IN ("MSys","USys") AND Type <> 1;


Hope that works

John
 
Back
Top