G
Guest
I have an update query run every time I close a form to update an inventory
count:
UPDATE ToolData AS T INNER JOIN ToolCribSignOut AS S ON
T.ToolCribDesignation=S.ToolCribDesignation SET T.Inventory =
T.Inventory+S.ReturnQuantity
WHERE S.[TIMESTAMP] = (SELECT MAX([TIMESTAMP]) FROM ToolCribSignOut);
I need to add a query right afterwards that asks:
If T.inventory > T.MinQuantity then calculate the difference between
LeadStart and Now() in days and multiply this result by the result of:
UPDATE ToolData AS T SET T.MinQuantity =
(DSum("SignOutQuantity","ToolCribSignOut","[ToolCribDesignation] = '" &
T.ToolCribDesignation & "' AND [DateModified] >= DateSerial(Year(Date()),
Month(Date()) -3, Day(Date()))")/90)*1.2
and assign a null value back to LeadStart
I would love some help. I think i have most of the code, but just don't know
how to fit it together.
Cheers.
count:
UPDATE ToolData AS T INNER JOIN ToolCribSignOut AS S ON
T.ToolCribDesignation=S.ToolCribDesignation SET T.Inventory =
T.Inventory+S.ReturnQuantity
WHERE S.[TIMESTAMP] = (SELECT MAX([TIMESTAMP]) FROM ToolCribSignOut);
I need to add a query right afterwards that asks:
If T.inventory > T.MinQuantity then calculate the difference between
LeadStart and Now() in days and multiply this result by the result of:
UPDATE ToolData AS T SET T.MinQuantity =
(DSum("SignOutQuantity","ToolCribSignOut","[ToolCribDesignation] = '" &
T.ToolCribDesignation & "' AND [DateModified] >= DateSerial(Year(Date()),
Month(Date()) -3, Day(Date()))")/90)*1.2
and assign a null value back to LeadStart
I would love some help. I think i have most of the code, but just don't know
how to fit it together.
Cheers.