Skip to content
Advertisement

How to calculate Sum and Subtraction from two different table

I have two table “tbl_In_Details” and “tbl_Out_Details” Sample data for tbl_In_Details

Now i want to calculate current stock i.e. (incoming – Outgoing) as Current_Stock i tried in such a way but not getting proper record please guide me where i need to modify my query:

My output should be

Advertisement

Answer

Use union all and aggregation:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement