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 […]

2007-04-12 (first published: )

461 reads

Blogs

Using Erik Darling’s sp_pressure_detector to resolve CPU issues

By

Last Friday I spent my lunch break going through some links I had marked...

How to Resolve Remove-AzKeyVaultKey : Operation returned an invalid status code ‘Forbidden’ Error

By

I’ve come across another error message in my seemingly never-ending battle with Azure Key...

Continuous integration and delivery (CI/CD) in Azure Data Factory using DevOps and GitHub - Part 2

By

(2020-Jan-28) This blog post is a followup to my previous post about DevOps (CI/CD) for...

Read the latest Blogs

Forums

Update parent row from child row that has partial data.

By pcq0125

On the same table I have table rows that are broken from the import...

Space issue on a table

By SQLAddict01

All,   I am working on implementing table partitioning on a existing table. The...

SSIS compoenents

By mcfarlandparkway

For SSIS to pickup any dll componenet where do we need to deploy?  some...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers