<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Help Refactor T-SQL Code to Databricks SQL in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/help-refactor-t-sql-code-to-databricks-sql/m-p/66875#M33213</link>
    <description>&lt;P&gt;Hello Community&lt;/P&gt;&lt;P&gt;Can someone help refactor the following T-SQL Code to Databricks SQL&lt;/P&gt;&lt;P&gt;CONVERT(DECIMAL(26, 8), ISNULL(xxx.xxxxxxx * ISNULL(RH.xxxxx, 1 / NULLIF(ST.xxxxxx, 0)), ST.xxxxx)) AS Amount&lt;/P&gt;&lt;P&gt;When I attempt to execute the above code I get the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in SQL statement: AnalysisException: Undefined function: 'CONVERT'. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2024 18:33:56 GMT</pubDate>
    <dc:creator>Carlton</dc:creator>
    <dc:date>2024-04-21T18:33:56Z</dc:date>
    <item>
      <title>Help Refactor T-SQL Code to Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-refactor-t-sql-code-to-databricks-sql/m-p/66875#M33213</link>
      <description>&lt;P&gt;Hello Community&lt;/P&gt;&lt;P&gt;Can someone help refactor the following T-SQL Code to Databricks SQL&lt;/P&gt;&lt;P&gt;CONVERT(DECIMAL(26, 8), ISNULL(xxx.xxxxxxx * ISNULL(RH.xxxxx, 1 / NULLIF(ST.xxxxxx, 0)), ST.xxxxx)) AS Amount&lt;/P&gt;&lt;P&gt;When I attempt to execute the above code I get the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error in SQL statement: AnalysisException: Undefined function: 'CONVERT'. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 18:33:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-refactor-t-sql-code-to-databricks-sql/m-p/66875#M33213</guid>
      <dc:creator>Carlton</dc:creator>
      <dc:date>2024-04-21T18:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help Refactor T-SQL Code to Databricks SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/help-refactor-t-sql-code-to-databricks-sql/m-p/66881#M33214</link>
      <description>&lt;P&gt;You can use CAST instead.&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;SELECT &lt;SPAN class=""&gt;cast&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;SPAN class=""&gt;'2024'&lt;/SPAN&gt; &lt;SPAN class=""&gt;as&lt;/SPAN&gt; &lt;SPAN class=""&gt;int&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Apr 2024 01:02:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/help-refactor-t-sql-code-to-databricks-sql/m-p/66881#M33214</guid>
      <dc:creator>AmanSehgal</dc:creator>
      <dc:date>2024-04-22T01:02:45Z</dc:date>
    </item>
  </channel>
</rss>

