Points: 53925

1/17/2023 9:47:35 AM

Creating a date calendar

* This article, and all our great MercuryBI documentation, Is available on the MercuryBI menu

Part one of two, so that I can put the topics on the menu in different places. 

Today's topic is creating a date calendar in SQL to use in reports. I'll show the importance of this in the next post, for now, just the practical code. 

Creating a date dimension or calendar table in SQL Server (

I've copied the code below with only minor edits from the link above. 

The output will look like this. This is only about half the columns, though, it's way too wide to show here.
Version: All
Section: SQL Scripts,Integration Manager,Crystal Reports,SSRS,SQL for Beginners,Mercury BI
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables