I want to do an update with the condition below:
SettlementAmount = CollectionAmount - (CollectionAmount * (3 / 100))
And this is what I'm doing:
UPDATE [dbo].[QuoteOptions]
SET SettlementAmount = CollectionAmount - (CollectionAmount * (3 / 100))
FROM [dbo].[Quotes]
JOIN [dbo].[QuoteOptions] ON [dbo].[Quotes].Id = [dbo].[QuoteOptions].QuoteId
WHERE [dbo].[Quotes].PaymentProfileId = 43
AND SettlementAmount = CollectionAmount
When I run this query, I get a message that two rows have been affected, but they are not actually! Could anyone be so kind as tell me what mistake I'm making?
collectionAmount is = 100
settlementAmount = 100
I want to make
settlementAmount = collectionAmount - (100 * (3 / 100))