Number of Weekdays between two dates - Set Based

Inspired by a post here at SQLServerCentral, I wrote this function to calculate the number of days between two dates that are weekdays. In order to achieve this I used a common SQL table that contains a sequence of number for 1 to X. This was used as an input to the datediff function, and […]

2004-12-24 (first published: )

286 reads

Blogs

T-SQL Tuesday #125 – Unit testing databases – we need to do this!!

By

Welcome to the first April edition of T-SQL Tuesday. I’m honoured to be hosting...

T-SQL Tuesday Live–7 Apr 2020

By

Last week went a little crazy, and I learned something: don’t post a Zoom...

Getting Your dbatools Version–#SQLNewBlogger

By

Another post for me that is simple and hopefully serves as an example for...

Read the latest Blogs

Forums

Dial sbcglobal helpline for Customer Service

By vancevanse0

SBCGlobal Email Settings: If you are going to use Sbcglobal for your email applications...

How not to have sql to restart on the same node but failover on 1st failure in a

By SQLRocker

Hi, By default sql tries to restart on the same node in case of...

Do I need to update statistics after compressing table?

By VoldemarG

I page-compressed a table with one Clustered and 4 non-clustered indexes, 5 million rows....

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers