0
I am making an application with Sql Server database and I want the database to work the calculations and not the application, but I’m having difficulties to do, I hope someone can help me in this issue.
These are the columns of the Product table, the data were entered manually, the columns Totalbuy and Totalsell are computed (Stock * Purchase price) and (Stock * Sale price), respectively. Now comes the difficulty, I want the value in the column Profit is also automatic being (Totalsale -Totalpurchase)
I don’t quite understand what you want?
– RXSD
I want to calculate value in the Profit column also automatically being (Totalvenda -Totalcompra). Let the calculation be done in the table. And not in the application.
– Marcelo CL
Wouldn’t just create another calculated column !?
– Motta
No Motta, because the columns Totalbuy and Totalsell are already Calculated Columns, I’ve tried this and it didn’t work.
– Marcelo CL
Do not just make a column calculated as follows:
Lucro = (ValorVenda - ValorCompra) * Estoque
?– Marcelo Shiniti Uchimura