SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Calendar Tables III - Changing Business Rules


Calendar Tables III - Changing Business Rules

Author
Message
tfifield
tfifield
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3727 Visits: 2890
James A Skipwith (2/17/2011)
Todd,

Nice article. I also have large calendar tables to deal with - as one of my clients uses a rolling four week cycle starting the first saturday before February the 2nd, so as well as fiscal weeks to deal with I also have week 1-4 four each four week block! I too do not worry about optimising the SQL to populate this, as performance is not a considuration here, accuracy is.

Plus how come you get away with one page of forum questions where I have 4+ each time!

Look forward to more articles.

James

James,
Don't know how I only got one page.

That rolling 4 week block is an interesting business requirement. I can see how a calendar table would make life easier. I've found that with proper indexing of both the calendar table and the data tables performance can be better in most cases

I'm planning on doing the next calendar table article on the dreaded 4-4-5 accounting periods where a fiscal quarter is composed of 13 weeks and it bears no relationship to calendar months.
Todd Fifield
David Conn
David Conn
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3772 Visits: 1208
Disappointing to see DateTime being used in this case where it is clearly a Date. Why bother with a Time portion to a Data Type when it will never be used ? If it's a Date then use the Data Type of DATE not DateTime or even SmallDateTime.
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