cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Help Refactor T-SQL Code to Databricks SQL

Carlton
Contributor

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'.

 

 

 

1 REPLY 1

AmanSehgal
Honored Contributor III

You can use CAST instead.

Eg:

SELECT cast('2024' as int);

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now