sqlsunday.com

T-SQL tips and tricks, best practices and query plans from the field.

Skip to content
  • sqlsunday.com
  • Structured Concepts
    • Master data tool
    • Send passwords
  • Slack app
  • Presentations
  • Downloads
  • Checklists
    • Installing SQL Server 2014
    • Installing SQL Server 2016
    • Installing SQL Server 2017
    • Installing SQL Server 2019
    • Links and utilities
Search

next business day

Calculating business days and holidays

2014-01-122014-06-20 / Daniel Hutmacher / 7 Comments

A common scenario you may have encountered is the need to calculate the first business day after a given date. There are quite a few ugly ways to solve this, including cursors, but there are also some pretty neat ways to approach the problem, and as a bonus, you’ll learn about recursion and the new LEAD(), LAG() functions and accumulation in T-SQL.

Continue reading →

Search

Categories

  • By difficulty (185)
    • Advanced (39)
    • Basics (54)
    • Intermediate (94)
  • CLR (1)
  • Code review (1)
  • Off-topic (14)
  • Rant (6)
  • Scripts (19)
  • Series (30)
    • Efficient data (8)
    • Introduction to T-SQL (1)
    • Slowly changing dimensions (5)
    • SQL Server security (16)
  • SQL Server concepts (77)
  • T-SQL (135)
  • Tips (54)
  • Uncategorized (1)
  • Videos (2)
Daniel Hutmacher, Structured Concepts AB

SQL SERVER HELP YOU CAN DEPEND ON.

Need SQL Server help?

At Structured Concepts, we specialize in SQL Server development and performance tuning, as well as technical training for users and developers.

Visit our homepage at strd.co.

Create a website or blog at WordPress.com