How to Find the Start and End Dates for the Current Week (and more)
Learn to calculate Start / First of Week, End of Week, Start of Next Week, Year, Quarter, and Month of the week, Week Numbers and more in T-SQL (Jeff Moden)
2022-07-13
33,629 reads
Learn to calculate Start / First of Week, End of Week, Start of Next Week, Year, Quarter, and Month of the week, Week Numbers and more in T-SQL (Jeff Moden)
2022-07-13
33,629 reads
In this tip we look at how to change specific parts of a date such as the Year, Month or Day for data stored in a SQL Server table.
2019-12-17
2017-11-20
645 reads
An inline table valued function (iTVF) that can be used to calculate age in years.
2016-04-27 (first published: 2016-04-06)
1,070 reads
Find minimum and maximum values for all date columns in a table or range of tables, using a mask.
2016-09-15 (first published: 2014-10-27)
3,049 reads
2013-03-11 (first published: 2013-02-20)
2,138 reads
Code to create a handy date calendar cross-reference table with a ton of pre-populated, slice-and-dice data field variations to aid in complex date parameterization / selection criteria.
2019-04-15 (first published: 2009-10-06)
16,823 reads
This function will return the first, second, third, fourth or last day of a given month.
2009-03-03 (first published: 2009-02-10)
1,186 reads
By Steve Jones
A customer was asking about tracking logins and logouts in Redgate Monitor. We don’t...
By Brian Kelley
Every year, the South Carolina State Internal Auditors Association and the South Carolina Midlands...
Data Céilí 2026 Call for Speakers is now live! Data Céilí (pronounced kay-lee), is...
Environment: SQL Server: 2019 Enterprise (15.0.4430.1) OS: Windows Server 2022 Standard (Build 20348) Virtualization:...
I am trying to create a filter on a SQL Server audit to capture...
I've come across what appears to be a strange deadlock anomaly. As seen in...
From T-SQL, without requiring an XEvent session, can I tell which deprecated features are being used on my instance?
See possible answers