Using the Northwinds database I created a query of all products. I used the
exact method mentioned to exclude all products of type "beverage" and
supplier "Mayumi's".
As previously stated, my original post was correct and works as stated.
Here is the SQL if you need to see it. You can create that in a query and
then view it in design view and you will see the exact method I outlined.
SELECT Products.ProductID, Products.ProductName, Suppliers.CompanyName,
Products.SupplierID, Categories.CategoryName, Products.CategoryID,
Products.QuantityPerUnit, Products.UnitPrice, Products.UnitsInStock,
Products.UnitsOnOrder, Products.ReorderLevel, Products.Discontinued
FROM Categories INNER JOIN (Suppliers INNER JOIN Products ON
Suppliers.SupplierID = Products.SupplierID) ON Categories.CategoryID =
Products.CategoryID
WHERE ((Not (Suppliers.CompanyName)="Mayumi's") AND (Not
(Categories.CategoryName)="Beverages"));
Rick B
Edward G said:
Rick,
I would suggest you actually try your suggestion out. I think you will find
that when
you use NOT in criteria it complicates things.
Ed
"Rick B" <Anonymous> wrote in message
Placing the criteria on one line will look for cases where both conditions
are met. Placing on two lines will look for cases where either condition
is
met. this is basic query stuff here. Nothing fancy.
Rick b
Then Rick, how do explain the fact that your suggestion does not work?
Ed
"Rick B" <Anonymous> wrote in message
Wrong.
Ccriteria on one line form an "AND" operation (both must be true).
Placing
them on two lines forms an "OR" operation (either must match)
Well troubled, I'm no expert but I don't think this is as
simple
as
Rick
is
suggesting. I think his criteria will eliminate
all records that have EITHER IBM as a vendor or consultant type as
Outsourced and you are only interested in
eliminating records where BOTH are true. As I said, I am no expert,
so
I
tend to come up with Rube Goldbergesque
solutions. I make the mechanisms that I understand work, even
if
it
means
an
inordinate amount of steps. In your case, I would create
an expression in my query
......Iif([ConsultantType]<>"Outsourced",1,0)
then another expression (yes, another column)
.....Iif([VendorName]<>"IBM",
1,0)
then another expression (let's call it Mary) that adds Expr1 to
Expr2
Then another query that calls up all the values in this first query
except
in the criteria for Mary enter >0
As I said, simple elegant solutions are not my forte. I work with
what
little I understand and go from there.
Hope this helps.
Ed G
I am trying to build a query to omit all records that two
different
controls,
but I am not sure how to do it. Could someone step me
through
it?
Example:
IIf(Consultant Type = "Outsourced" & Vendor Name = "IBM", don't
show
record)