Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Date Calendar Expand / Collapse
Author
Message
Posted Friday, October 9, 2009 6:20 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, August 22, 2014 6:08 AM
Points: 341, Visits: 689
Comments posted to this topic are about the item Date Calendar
Post #800674
Posted Thursday, October 29, 2009 6:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 9, 2013 12:24 PM
Points: 2, Visits: 32
Thank you for the script, will be very useful.

Tony
Post #810683
Posted Thursday, October 29, 2009 6:25 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, August 22, 2014 6:08 AM
Points: 341, Visits: 689
My pleasure. Hope it helps!
Post #810687
Posted Thursday, October 29, 2009 6:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 12, 2014 7:29 AM
Points: 6, Visits: 44
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



Post #810697
Posted Thursday, October 29, 2009 6:45 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, August 22, 2014 6:08 AM
Points: 341, Visits: 689
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.
Post #810706
Posted Thursday, October 29, 2009 10:54 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Thursday, July 24, 2014 3:52 AM
Points: 470, Visits: 705
Nice-looking date dimension table.
Post #810999
Posted Thursday, October 29, 2009 11:02 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, August 22, 2014 6:08 AM
Points: 341, Visits: 689
Thanks! Dates can be a REAL pain to work with sometimes, so I figured that this could help a lot of people.
Post #811010
Posted Thursday, October 29, 2009 6:16 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 29, 2014 5:01 AM
Points: 66, Visits: 105
@svontilbon: works fine in sqlserver 2008 express
Post #811308
Posted Thursday, October 29, 2009 6:35 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, January 29, 2014 5:01 AM
Points: 66, Visits: 105
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 !
Post #811312
Posted Friday, October 30, 2009 6:29 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, August 22, 2014 6:08 AM
Points: 341, Visits: 689
I'll put it on the to do list. :) 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.
Post #811505
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse