I am trying to link an Access Database to some SQL tables and I need to translate some code into a stored procedure.
I am having problems translating the I statements into a proper t-SQL format. I am stuck on how to do and update and set statement with an IF THEN or CASE statement embedded. Please help..
The code in bold is code taken from the Access database
CREATE PROCEDURE sp_CompAssess
AS
update TMultExam
set
If TMaster.MeasurableProd > 0 Then
AssessedDollars = (TMaster.MeasurableProd * Percentage) / 100
Else
AssessedDollars = ((TMaster.Tax + TMaster.Penalty + TMaster.Interest) * Percentage)/100
End If
AuditCount = (Percentage * TMaster.AudCount) / 100
from tmultExam, Tmaster
Where TMaster.RecordNumber = TMultExam.RecordNumber
I am having problems translating the I statements into a proper t-SQL format. I am stuck on how to do and update and set statement with an IF THEN or CASE statement embedded. Please help..
The code in bold is code taken from the Access database
CREATE PROCEDURE sp_CompAssess
AS
update TMultExam
set
If TMaster.MeasurableProd > 0 Then
AssessedDollars = (TMaster.MeasurableProd * Percentage) / 100
Else
AssessedDollars = ((TMaster.Tax + TMaster.Penalty + TMaster.Interest) * Percentage)/100
End If
AuditCount = (Percentage * TMaster.AudCount) / 100
from tmultExam, Tmaster
Where TMaster.RecordNumber = TMultExam.RecordNumber