G
Guest
I have two queries, where each accept parameters. I'm using the DLookup to
call the one query from within the other, however I don't know how I go about
sending the parameters from the outer query to the inner. Below are my
queries.
Query1. (name = sp_GetTableInvoiceNo)
SELECT Invoice_Number
FROM Invoice_OnHold
WHERE OnHoldID = [@TableNo]
AND Cashier_ID = [@CashierID]
AND Store_ID = [@Store_ID];
Query2. (name = sp_GetInvoiceItems)
SELECT ItemNum, Quantity
FROM Invoice_Itemized
WHERE Invoice_Number=DLookup("[Invoice_Number]","sp_GetTableInvoiceNo")
And CashierID=[@CashierID]
As you can see I need to pass 3 parameters from the outer query to the
inner. How can this been do.
Thanks
call the one query from within the other, however I don't know how I go about
sending the parameters from the outer query to the inner. Below are my
queries.
Query1. (name = sp_GetTableInvoiceNo)
SELECT Invoice_Number
FROM Invoice_OnHold
WHERE OnHoldID = [@TableNo]
AND Cashier_ID = [@CashierID]
AND Store_ID = [@Store_ID];
Query2. (name = sp_GetInvoiceItems)
SELECT ItemNum, Quantity
FROM Invoice_Itemized
WHERE Invoice_Number=DLookup("[Invoice_Number]","sp_GetTableInvoiceNo")
And CashierID=[@CashierID]
As you can see I need to pass 3 parameters from the outer query to the
inner. How can this been do.
Thanks