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

Microsoft Tools That Help Query Tuning

By

Query tuning is not easy. In fact, for a lot of people, you shouldn’t...

Author of the Year 2019 Nomination at MSSQLTips

By

This year I’ve been nominated again for the Author of the Year award at...

Extended Events Misperceptions: Profiler is Easier

By

I know, I know, I’m on #teamexevents so I think that Extended Events can...

Read the latest Blogs

Forums

Upgrading SQL Service Packs on multiple versions

By Lord Slaagh

Hello SSC, My company has SQL versions that range between 2008 R2 to SQL...

Dynamic images within my report

By Shabbaranks

Hi, Im trying to get dynamic images in my report based on a Tablix...

Setting fill factor on an auto-increment INT clustered index

By Mr. Holio

Hi all, Please consider the following table structure. CREATE TABLE [dbo].[Transactions]( [Id] [int] IDENTITY(1,1)...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers