Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating dimTime for Holidays

Status
Not open for further replies.

ErnestDCook

Programmer
Jul 30, 2015
1
0
0
US
Needing to have holidays noted in my dimTime table created with the BI tools I started my search. I started with adding a new bit field (isHoliday). Failing to find a perfect solution I started putting together posts. First a shout out to the below thread that gave me the core logic for updating the dimTime table for thanksgiving days

UPDATE [AllianceDW].[dbo].[dimTime]
SET [IsHoliday] = '1'
WHERE pk_date IN
(SELECT DISTINCT TOP 100
dateadd(wk, datediff(wk, 0, convert(varchar(4), convert(smallint,YEAR([year])))+'1124'), 3)
FROM dimtime
ORDER BY dateadd(wk, datediff(wk, 0, convert(varchar(4), convert(smallint,YEAR([year])))+'1124'), 3)
)


Than another post gave me a lot of other holidays. It is at:
 
faq183-5075

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 


gmmastros said:
FAQ183-5075: Holiday Calendar Calculator

Good stuff, George. I like how Mardi Gras is primarily named Paczki Day.

-----------
With business clients like mine, you'd be better off herding cats.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top