Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Date Calendar


Date Calendar

Author
Message
Sean Smith-776614
Sean Smith-776614
SSC-Addicted
SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)

Group: General Forum Members
Points: 429 Visits: 942
Comments posted to this topic are about the item Date Calendar
Tony Soucie
Tony Soucie
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 32
Thank you for the script, will be very useful.

Tony
Sean Smith-776614
Sean Smith-776614
SSC-Addicted
SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)

Group: General Forum Members
Points: 429 Visits: 942
My pleasure. Hope it helps!
SVonTilbon
SVonTilbon
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 63
I'm getting syntax errors in SQL 2008 in the Northwind D-Base beginning with this line...:
WITH cte_date_base_table AS

Also it doesn't recognize ROW_NUMBER as a function name.

Help!

SVonTilbon



Sean Smith-776614
Sean Smith-776614
SSC-Addicted
SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)

Group: General Forum Members
Points: 429 Visits: 942
It was developed on SQL Server 2005, though it should work on 2008. Have you tried running it on a different database? Also, sometimes when you copy scripts from SQLServerCentral.com it also copies "funky" (and sometimes "invisible") characters with the code. It's happened to me and I've needed to reformat the code before it would run. Hope this helps.

Isn't Northwind SQL 2000? You need at least 2005 for the code to work as ROW_NUMBER is not recognized in 2000 nor is CTE.
Nice Marmot
Nice Marmot
Mr or Mrs. 500
Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)Mr or Mrs. 500 (503 reputation)

Group: General Forum Members
Points: 503 Visits: 767
Nice-looking date dimension table. :-)
Sean Smith-776614
Sean Smith-776614
SSC-Addicted
SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)

Group: General Forum Members
Points: 429 Visits: 942
Thanks! Dates can be a REAL pain to work with sometimes, so I figured that this could help a lot of people.
ldemeyer@telenet.be
ldemeyer@telenet.be
Valued Member
Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)

Group: General Forum Members
Points: 66 Visits: 110
@svontilbon: works fine in sqlserver 2008 express
ldemeyer@telenet.be
ldemeyer@telenet.be
Valued Member
Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)Valued Member (66 reputation)

Group: General Forum Members
Points: 66 Visits: 110
Thank you for sharing this, dates are kind of "fun" (or a pain). Now the script only lacks a parameter to set the first day in the week to Monday (= the case in Europe) and to add a column isoweek (isoweek 1= first week with at least 4 days in it I guess) - for example 1 January 2010 is in week 53 of the year 2009 ! so isoweek 200953 or something like that.

Guess that is work for somebody else ! ;-)
Sean Smith-776614
Sean Smith-776614
SSC-Addicted
SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)SSC-Addicted (429 reputation)

Group: General Forum Members
Points: 429 Visits: 942
I'll put it on the to do list. Smile Great idea. As for the first day of the week, it should change automatically to whatever your SQL Server instance settings are. So if day 1 is Monday rather than Sunday, the code should compensate for this. Hope that helps.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search