G
Guest
Following the advice offered on Allen Brownes Page, I have designed my stock
control system with a qtyOnhand function. I also required stock takes but
rather than the single stock take table, I modified it to have a stocktake
table and
a stocktakedetail table.
However I am unable to get the onHand function to search properly as I dont
fully understand the select TOP 1.
I have been trying this:
strSQL = "SELECT TOP 1 StockTakeDate, Quantity FROM tblStockTake INNER JOIN
tblStockTakeDetail " & _
"ON tblStockTake.StockTakeID = tblStockTakeDetail.StockTakeID" & _
"WHERE ((ProductID = " & lngProduct & ")" & strDateClause & _
") ORDER BY StockTakeDate DESC;"
but to no avail!
Can anyone offer some Advice.
Thank you.
Kenny
control system with a qtyOnhand function. I also required stock takes but
rather than the single stock take table, I modified it to have a stocktake
table and
a stocktakedetail table.
However I am unable to get the onHand function to search properly as I dont
fully understand the select TOP 1.
I have been trying this:
strSQL = "SELECT TOP 1 StockTakeDate, Quantity FROM tblStockTake INNER JOIN
tblStockTakeDetail " & _
"ON tblStockTake.StockTakeID = tblStockTakeDetail.StockTakeID" & _
"WHERE ((ProductID = " & lngProduct & ")" & strDateClause & _
") ORDER BY StockTakeDate DESC;"
but to no avail!
Can anyone offer some Advice.
Thank you.
Kenny