Dear all...
After trying and find the below update query but i am not able to achieve what i required.
After excuting the UPDATE query its updating by concatenate the output values (mentioned bold in table)Code:Dim conn1 As New OleDbConnection("My Connection String") Dim query1 As String = "UPDATE CashDepositTran SET CashDepositTran.WidrawAmt = CashDepositTran.WidrawAmt - '" & outPutString & "' WHERE CashDepositTran.CTranID IN (1,2)" Dim Cmd1 As New OleDbCommand(query1, conn1) conn1.Open() With Cmd1 .ExecuteNonQuery() End With Cmd1.Dispose() conn1.Close()
Table: CashDepositTran (Before UPDATE Query)
CTranID | CRegID | CashDepDate | UserID | DepAmt | WidrawAmt
1 | 1 | 09/Mar/2013 | 123 | 10000 | 10000
2 | 1 | 09/Mar/2013 | 123 | 500 | 500
10000500 and updating in each rows as below
Table: CashDepositTran (After UPDATE Query)
CTranID | CRegID | CashDepDate | UserID | DepAmt | WidrawAmt
1 | 1 | 09/Mar/2013 | 123 | 10000 | -9990500
2 | 1 | 09/Mar/2013 | 123 | 500 | -10000000




Reply With Quote