PARAMETERS Declaration Examples

 

SQL statement

Description

 

PARAMETERS [Enter a Last Name:] Text;
SELECT *
FROM Employees
WHERE [Enter a Last Name:] = [Last Name]

Requries that your program provide the parameter and then uses that parameter as the criteria for the query

PARAMETERS [Enter a category ID:] Text;
SELECT DISTINCTROW
[Category ID], [Product Name],
Count([Order Details].[Order ID]) AS Tally
FROM Products, [Order Details], Products INNER JOIN [Order Details]
ON Products.[Product ID] = [Order Details].[Product ID]
GROUP BY [Category ID], [Product Name]
HAVING [Category ID] = [Enter a category ID:]

Requries that your program provide the category ID parameter and then uses that entry as the criteria for the query