diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py
index 8782be364a342573240bd457da1a275b4de55fe7..02e5a2d19b7ff32ff403df0574474ce99aa97946 100644
--- a/product/ZSQLCatalog/SQLCatalog.py
+++ b/product/ZSQLCatalog/SQLCatalog.py
@@ -1936,8 +1936,12 @@ class Catalog(Folder,
           if subquery is not None:
             append(subquery)
       logical_operator = node.getLogicalOperator()
+      if logical_operator == 'not':
+        query_logical_operator = None
+      else:
+        query_logical_operator = logical_operator
       for comparison_operator, value_list in value_dict.iteritems():
-        append(search_key.buildQuery(value_list, comparison_operator=comparison_operator, logical_operator=logical_operator))
+        append(search_key.buildQuery(value_list, comparison_operator=comparison_operator, logical_operator=query_logical_operator))
       if logical_operator == 'not' or len(query_list) > 1:
         result = ComplexQuery(query_list, logical_operator=logical_operator)
       elif len(query_list) == 1: