Z
zh.zhen
I have create an query in access like blow, which named spProductList:
SELECT ProductID,ProductName,CategoryID FROM Product
And I want to do a filter by CategoryID,then create an another query
named spProductListByCatID:
PARAMETERS [@intCatID] SHORT;
SELECT ProductID,ProductName,CategoryID FROM Product Where CategoryID =
[@intCatID]
The Problem is:
1. I can do an query in access like:
SELECT * FROM spProductList
it lists all record.
2. But I can't do it like this:
SELECT * FROM spProductListByCatID('@intCatID=1')
It seems I can not set a variable to an query in this way. how can I
share spProductListByCatID in another qurey and set a value to the
variable directly?
SELECT ProductID,ProductName,CategoryID FROM Product
And I want to do a filter by CategoryID,then create an another query
named spProductListByCatID:
PARAMETERS [@intCatID] SHORT;
SELECT ProductID,ProductName,CategoryID FROM Product Where CategoryID =
[@intCatID]
The Problem is:
1. I can do an query in access like:
SELECT * FROM spProductList
it lists all record.
2. But I can't do it like this:
SELECT * FROM spProductListByCatID('@intCatID=1')
It seems I can not set a variable to an query in this way. how can I
share spProductListByCatID in another qurey and set a value to the
variable directly?