Can anybody please help me to convert this Access function to SQL Server function?
Public Function MarginPercent(pCost As Currency, pRetail As Currency) As Double
If pRetail = 0 Then
MarginPercent = 0
Else
If pCost = 0 Then
MarginPercent = 1
Else
MarginPercent = 1 - (pCost / pRetail)
End If
End If
End Function
Thanks,
Susrutha.
Public Function MarginPercent(pCost As Currency, pRetail As Currency) As Double
If pRetail = 0 Then
MarginPercent = 0
Else
If pCost = 0 Then
MarginPercent = 1
Else
MarginPercent = 1 - (pCost / pRetail)
End If
End If
End Function
Thanks,
Susrutha.