<?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 How get days of year with sql in databricks. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-get-days-of-year-with-sql-in-databricks/m-p/7929#M3665</link>
    <description />
    <pubDate>Fri, 10 Mar 2023 21:19:39 GMT</pubDate>
    <dc:creator>Everton_Costa</dc:creator>
    <dc:date>2023-03-10T21:19:39Z</dc:date>
    <item>
      <title>How get days of year with sql in databricks.</title>
      <link>https://community.databricks.com/t5/data-engineering/how-get-days-of-year-with-sql-in-databricks/m-p/7929#M3665</link>
      <description />
      <pubDate>Fri, 10 Mar 2023 21:19:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-get-days-of-year-with-sql-in-databricks/m-p/7929#M3665</guid>
      <dc:creator>Everton_Costa</dc:creator>
      <dc:date>2023-03-10T21:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How get days of year with sql in databricks.</title>
      <link>https://community.databricks.com/t5/data-engineering/how-get-days-of-year-with-sql-in-databricks/m-p/7930#M3666</link>
      <description>&lt;P&gt;I hope it helps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT  DATEADD(DAY, rnk - 1, '{{StartDate}}')
FROM    (
    WITH lv0(c) AS(
    SELECT 1 as c
    UNION ALL
    SELECT 1
    )
    , lv1 AS (
    Select t1.c
    from lv0 t1
    cross JOIN lv0  t2
    )
     , lv2 AS (
    Select t1.c
    from lv1 t1
    cross JOIN lv1  t2
    )
    
    , lv3 AS (
    Select t1.c
    from lv2 t1
    cross JOIN lv2  t2
    )
     , lv4 AS (
    Select t1.c
    from lv3 t1
    cross JOIN lv3  t2
    )
    SELECT ROW_NUMBER() OVER (ORDER BY (SELECT 1)) rnk   FROM lv4
    ) tbl
WHERE   rnk - 1 &amp;lt;= DATEDIFF(DAY, '{{StartDate}}', '{{EndDate}}')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 21:42:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-get-days-of-year-with-sql-in-databricks/m-p/7930#M3666</guid>
      <dc:creator>Cami</dc:creator>
      <dc:date>2023-03-10T21:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: How get days of year with sql in databricks.</title>
      <link>https://community.databricks.com/t5/data-engineering/how-get-days-of-year-with-sql-in-databricks/m-p/7931#M3667</link>
      <description>&lt;P&gt;Thanks for the answer, could you explain the code to me or share a link that explains it please?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 14:09:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-get-days-of-year-with-sql-in-databricks/m-p/7931#M3667</guid>
      <dc:creator>Everton_Costa</dc:creator>
      <dc:date>2023-03-13T14:09:55Z</dc:date>
    </item>
  </channel>
</rss>

