<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: SQL Puzzle: SQL Advance Query – Count total number of Working Days between Two Dates	</title>
	<atom:link href="https://www.dbrnd.com/2018/03/sql-puzzle-count-total-number-of-working-days-between-two-dates/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2018/03/sql-puzzle-count-total-number-of-working-days-between-two-dates/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Fri, 03 May 2019 10:29:34 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>
		By: HIC		</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-count-total-number-of-working-days-between-two-dates/#comment-7090</link>

		<dc:creator><![CDATA[HIC]]></dc:creator>
		<pubDate>Fri, 03 May 2019 10:29:34 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7170#comment-7090</guid>

					<description><![CDATA[PL/SQL:
with wd(wday) as (
  select to_date(&#039;01.01.2018&#039;, &#039;dd.mm.yyyy&#039;) from dual
  union all
  select wday + 1 from wd where wday &#060; to_date(&#039;31.01.2018&#039;, &#039;dd.mm.yyyy&#039;)
)
select count(wday) 
from wd
where to_char(wday, &#039;d&#039;) not in (1, 7);]]></description>
			<content:encoded><![CDATA[<p>PL/SQL:<br />
with wd(wday) as (<br />
  select to_date(&#8216;01.01.2018&#8217;, &#8216;dd.mm.yyyy&#8217;) from dual<br />
  union all<br />
  select wday + 1 from wd where wday &lt; to_date(&#039;31.01.2018&#039;, &#039;dd.mm.yyyy&#039;)<br />
)<br />
select count(wday)<br />
from wd<br />
where to_char(wday, &#039;d&#039;) not in (1, 7);</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: VINUTNA		</title>
		<link>https://www.dbrnd.com/2018/03/sql-puzzle-count-total-number-of-working-days-between-two-dates/#comment-6456</link>

		<dc:creator><![CDATA[VINUTNA]]></dc:creator>
		<pubDate>Tue, 22 May 2018 11:21:08 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7170#comment-6456</guid>

					<description><![CDATA[declare @startdate date = &#039;2018-01-01&#039;
declare @EndDate date = &#039;2018-01-31&#039;
declare @working_days int = 0
while (@startdate &#060;= &#039;2018-01-31&#039;)
begin
     select @working_days = case when DATENAME(weekday, @startdate) IN (&#039;Saturday&#039;, &#039;Sunday&#039;) then @working_days
	 else @working_days +1
	 end 
	 select @startdate = dateadd(day,1,@startdate)
end
select @working_days]]></description>
			<content:encoded><![CDATA[<p>declare @startdate date = &#8216;2018-01-01&#8217;<br />
declare @EndDate date = &#8216;2018-01-31&#8217;<br />
declare @working_days int = 0<br />
while (@startdate &lt;= &#039;2018-01-31&#039;)<br />
begin<br />
     select @working_days = case when DATENAME(weekday, @startdate) IN (&#039;Saturday&#039;, &#039;Sunday&#039;) then @working_days<br />
	 else @working_days +1<br />
	 end<br />
	 select @startdate = dateadd(day,1,@startdate)<br />
end<br />
select @working_days</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
