cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Help Refactor T-SQL Code to Databricks SQL

Carlton
New Contributor III

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);
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.