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

479 reads

Blogs

Redgate Summit Comes to the Windy City

By

I love Chicago. I went to visit three times in 2023: a Redgate event,...

Non-Functional Requirements

By

I have found that non-functional requirements (NFRs) can be hard to define for a...

Techorama 2024 – Slides

By

You can find the slidedeck for my Techorama session “Microsoft Fabric for Dummies” on...

Read the latest Blogs

Forums

Table partitioning best practice

By JasonO

I've inherited a couple of rather large databases from my ex-colleague when I join...

Identifying Customer Buying Pattern in Power BI - Part 2

By Farooq Aziz

Comments posted to this topic are about the item Identifying Customer Buying Pattern in...

Finding Marks

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Finding Marks

Visit the forum

Question of the Day

Finding Marks

I have marked a few transactions in my code. How can I find out which marks were stored in a transaction log?

See possible answers