addition from one table to another.

I

InventoryQueryGuy

I have this query where my Sign out form subtracts the quantity value from
the inventory list in another table. I know that this is not recommended and
that I should run the query overall each time but this is not possible. It
works like a charm when subtracting values, but when using the return form I
tried to modify the query so that the value would add back onto the inventory
value.
ex. 4+3=7! Instead I have attached the values together ...so 43.

Here is my query:
UPDATE ToolData AS T INNER JOIN ToolCribSignOut AS S ON
T.ToolCribDesignation=S.ToolCribDesignation SET T.Inventory =
T.Inventory+S.ReturnQuantity
WHERE S.[DateModified] = (SELECT MAX([DateModified]) FROM ToolCribSignOut)
and S.[TimeModified] = (SELECT MAX([TimeModified]) FROM ToolCribSignOut);

The same query was used for the sign out, but the '+' was '-', and one table
heading has changed. Any suggestions please???!!
 
L

Lucas Kartawidjaja

Just a hunch ... by any chance either the T.Inventory or S.ReturnQuantity
column have text datatype?

Lucas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top