Help Refactor T-SQL Code to Databricks SQL

Carlton
Contributor II

Hello Community

Can someone help refactor the following T-SQL Code to Databricks SQL

CONVERT(DECIMAL(26, 8), ISNULL(xxx.xxxxxxx * ISNULL(RH.xxxxx, 1 / NULLIF(ST.xxxxxx, 0)), ST.xxxxx)) AS Amount

When I attempt to execute the above code I get the following error:

Error in SQL statement: AnalysisException: Undefined function: 'CONVERT'.

 

 

 

AmanSehgal
Honored Contributor III

You can use CAST instead.

Eg:

SELECT cast('2024' as int);