Aan de slagGa gratis aan de slag

Try out a calendar table

Calendar tables are also known in the warehousing world as date dimensions. A calendar table is a helpful utility table which you can use to perform date range calculations quickly and efficiently. This is especially true when dealing with fiscal years, which do not always align to a calendar year, or holidays which may not be on the same date every year.

In our example company, the fiscal year starts on July 1 of the current calendar year, so Fiscal Year 2019 started on July 1, 2019 and goes through June 30, 2020. All of this information is in a table called dbo.Calendar.

Deze oefening maakt deel uit van de cursus

Time Series Analysis in SQL Server

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

-- Find Tuesdays in December for calendar years 2008-2010
SELECT
	c.Date
FROM dbo.___ c
WHERE
	c.___ = 'December'
	AND c.___ = 'Tuesday'
	AND c.___ BETWEEN 2008 AND 2010
ORDER BY
	c.Date;
Code bewerken en uitvoeren