0

I am trying to code an accounting software.

Here is my problem, I'm trying to subtract values between two tables but with same ID's. Let me show an example.

I mean, I want to subtract table2 from table1 like; CHAIR quantity is "10" i want to subtract "2" and i want to update table1's quantity as "8" as you can see in the tables they are not in order they are mixed.

So table2 products need to find their pair then subtract the quantity from their value. enter image description here

  • 1
    You should join the data of the two tables using the `PRODUCT` column to know the difference and then update the stock table (I believe you named it `table1`) with the calculated value. This question is likely already asked/answered, let me check a similar one – Cleptus Mar 25 '22 at 09:25
  • Does this answer your question? [SQL Updating from an inner join](https://stackoverflow.com/questions/12882212/sql-updating-from-an-inner-join) – Cleptus Mar 25 '22 at 09:25
  • No sir i want to learn Subtract value between two tables with access and c# – Mehmet KURTOW Mar 25 '22 at 09:44
  • I understand what do you want, I think you did not understand what I was trying to explain. Check the link I provided, is is very similar and could help you. – Cleptus Mar 25 '22 at 10:20
  • Not sure what C# has to do with it - this is just an update query in SQL. Can you call an update query or use SQL from your program? Or is that your question - how do I execute SQL in C#? – dbmitch Mar 25 '22 at 16:33

0 Answers0