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: )

493 reads

Blogs

T-SQL Tuesday #192: SQL Server 2025 Backup Changes

By

I hosted this month, but I decided to put my own entry in as...

Why Databases Still Fascinate Me

By

I get asked a lot about why or how I began working with databases...

Monday Monitor Tips: ServiceNow Integration

By

Earlier this year I visited a customer that was using the Redgate Monitor webhook...

Read the latest Blogs

Forums

Member was not found in the cube when the string

By giles.clapham

Hey, I've not done a cube for many years but I find myself supporting...

Implementing PostgreSQL with Python for Real-Time Logging and Monitoring

By sabyda

Comments posted to this topic are about the item Implementing PostgreSQL with Python for...

Identify a Slipstream Installation

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Identify a Slipstream Installation

Visit the forum

Question of the Day

Identify a Slipstream Installation

I get a new SQL Server instance from my build team. How can I tell if the instance was installed using a slipstream installation later?

See possible answers