I am running this function in a query and I am getting zeros as the result which is not correct in all instances. Can you take a look and give me your opinion on the code:
Public Function GetEESSI(YTDSS As Double, EstTax As Double) As Double
Dim SSIMaxPay As Double
Dim SSIEeBasis As Double
SSIMaxPay = 4624.2
SSIEeBasis = 0.042
If YTDSS >= SSIMaxPay Then
GetESSI = 0
ElseIf ([EstTax] * [SSIEeBasis]) + YTDSS > SSIMaxPay Then
GetESSI = [SSIMaxPay] - [YTDSS]
Else
GetESSI = [EstTax] * [SSIEeBasis]
End If
End Function
Thanks
Public Function GetEESSI(YTDSS As Double, EstTax As Double) As Double
Dim SSIMaxPay As Double
Dim SSIEeBasis As Double
SSIMaxPay = 4624.2
SSIEeBasis = 0.042
If YTDSS >= SSIMaxPay Then
GetESSI = 0
ElseIf ([EstTax] * [SSIEeBasis]) + YTDSS > SSIMaxPay Then
GetESSI = [SSIMaxPay] - [YTDSS]
Else
GetESSI = [EstTax] * [SSIEeBasis]
End If
End Function
Thanks