Pergunta

I am trying to come up with a query using SQL Server CE. I have a column Qty and I want to subtract from the column as the user enters an amount. Here is what I have:

UPDATE ItemInventoryControl
SET Stocks = SUM(Stocks - @Stocks)
WHERE (ItemName = @ItemName)

But is not working, I get an error:

SQL Execution Error

Error Source: SQL Server Compact ADO.NET Data Provider
Error Message: Not Implemented

Foi útil?

Solução

I figured out my mistake, it should be:

UPDATE       ItemInventoryControl
SET          Stocks = Stocks - @Stocks
WHERE        (ItemName = @ItemName)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top