<?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 &#8211; Count the total Working days from the given dates	</title>
	<atom:link href="https://www.dbrnd.com/2017/10/sql-puzzle-sql-advance-query-count-the-total-working-days-from-the-given-dates/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com/2017/10/sql-puzzle-sql-advance-query-count-the-total-working-days-from-the-given-dates/</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Sat, 04 Nov 2017 06:11:28 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>
		By: Dinesh		</title>
		<link>https://www.dbrnd.com/2017/10/sql-puzzle-sql-advance-query-count-the-total-working-days-from-the-given-dates/#comment-5980</link>

		<dc:creator><![CDATA[Dinesh]]></dc:creator>
		<pubDate>Sat, 04 Nov 2017 06:11:28 +0000</pubDate>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5962#comment-5980</guid>

					<description><![CDATA[DECLARE @StartDate AS DATE = &#039;2017-09-01&#039;
DECLARE @EndDate AS DATE = &#039;2017-09-30&#039;

;
WITH CTE
As
(Select @StartDate As FromDate,Datename(DW,@StartDate) As DayName
Union All
Select DateAdd(Day,1,FromDate),DateName(DW,DateAdd(Day,1,FromDate))
From CTE Where FromDate&#060;@EndDate)
Select Count(*) As NoOfWorkingDay
From CTE Where DayName Not In(&#039;Sunday&#039;,&#039;SaturDay&#039;)]]></description>
			<content:encoded><![CDATA[<p>DECLARE @StartDate AS DATE = &#8216;2017-09-01&#8217;<br />
DECLARE @EndDate AS DATE = &#8216;2017-09-30&#8217;</p>
<p>;<br />
WITH CTE<br />
As<br />
(Select @StartDate As FromDate,Datename(DW,@StartDate) As DayName<br />
Union All<br />
Select DateAdd(Day,1,FromDate),DateName(DW,DateAdd(Day,1,FromDate))<br />
From CTE Where FromDate&lt;@EndDate)<br />
Select Count(*) As NoOfWorkingDay<br />
From CTE Where DayName Not In(&#039;Sunday&#039;,&#039;SaturDay&#039;)</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
