UPDATE BSET AmountBasedOn = CASE WHEN TRY_CAST(B.SalaryFormulaValue AS FLOAT) IS NOT NULL THEN CAST(B.SalaryFormulaValue AS FLOAT) * -1 ENDFROM TDMSALARY AS BINNER JOIN TDMSALARY AS A ON A.Oid = B.HeaderSalaryIDWHERE CAST(SalaryFormula AS VARCHAR(1000)) LIKE '%UMT%'--

SELECT
SalaryFormulaValue
--, CASE WHEN TRY_CAST(B.SalaryFormulaValue AS FLOAT) IS NOT NULL THEN CAST(B.SalaryFormulaValue AS FLOAT) * -1 END AS A
, CAST('(60000/25)' AS FLOAT) AS B
FROM TDMSALARY AS B
WHERE SalaryFormulaValue IS NOT NULL