Technical Article

UDF for date ranges around a given date (updated)

UDF - SQL 2000 and higherThis function returns an 18 row table of date ranges around a given date.The ranges are: Day, Week (Sunday to Saturday), Month, Quarter, Half Year, Year.For each range there are 3 values: Previous, Same and NextExample of usage:Joined to an orders table:Select r.period, count(o.order_id)from orders oinner join dbo.ufn_date_ranges('2003-04-01') ron o.order_date […]

You rated this post out of 5. Change rating

2007-04-12 (first published: )

481 reads

Blogs

Jan Vaněk: Na podpis smlouvy jsem přišel v kiltu a teď vedu SWAT tým

By

The post Jan Vaněk: Na podpis smlouvy jsem přišel v kiltu a teď vedu...

MVP No more, But It’s OK

By

Embracing Limitations: Finding Strength and Purpose in Hard Times For four years, I was...

Read the latest Blogs

Forums

Copy Logins from on prem to Managed Instance

By BAM

Hello, I try to migrate SQL on Prem Instances to SQL Managed Instances. I'm...

Error while Simultaneous Switching and BCP in same table

By saum70

Hi, Our application is created in VC++. We have House keeping process in which...

Updating a Cryptographic Provider for EKM with Azure Key Vault - Level 5 of the Stairway to TDE

By VishnuGupthanSQLPowershellDBA

Comments posted to this topic are about the item Updating a Cryptographic Provider for...

Visit the forum

Question of the Day

Query Store for DDL

How do I configure Query Store to capture plans for CREATE and ALTER DDL commands in SQL Server 2022?

See possible answers