Do you avoid parameter queries with EXISTS keyword and comparison operators (<> or =)(Upsizing Problem)?

Updated by Brady Stroud [SSW] 1 year ago. See history

123

The MS Upsizing Wizard cannot upsize Microsoft Access queries containing:

  • EXISTS <> FALSE/TRUE or
  • EXISTS = FALSE/TRUE

For example, the following query will not be upsized:

PARAMETERS [@Employee Last Name] Text ( 20 );
SELECT Orders.OrderID
, Orders.CustomerID
, Orders.EmployeeID
FROM Orders
WHERE EXISTS (SELECT EmployeeID
FROM Employees
WHERE LastName= [@Employee Last Name]
AND Employees.EmployeeID=Orders.EmployeeID) <> FALSE

❌ Figure: Figure: Bad example - Access query with EXISTS keyword and comparison operator

PARAMETERS [@Employee Last Name] Text ( 20 );
SELECT Orders.OrderID
, Orders.CustomerID
, Orders.EmployeeID
FROM Orders
WHERE EXISTS (SELECT EmployeeID
FROM Employees
WHERE LastName= [@Employee Last Name]
AND Employees.EmployeeID=Orders.EmployeeID)

✅ Figure: Figure: Good example - Access query with EXISTS keyword and without comparison operator

In order to get the good example syntax you must switch from Design View window to SQL View in query designer window and save query definition.

acknowledgements
related rules