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 «««1234

4-4-5 Calendar Functions, Part 1 Expand / Collapse
Author
Message
Posted Monday, September 6, 2010 7:57 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, June 2, 2014 8:40 AM
Points: 39, Visits: 296
There sure are a lot of variations on this idea. The accountants are even trickery than I thought. :)


Post #981118
Posted Monday, September 6, 2010 11:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 6, 2010 11:23 AM
Points: 1, Visits: 29
Cliff:

I don't know if it was mentioned earlier, but many retail related businesses use a 4-5-4 calendar determined by the National Retail Federation (http://www.nrf.com/modules.php?name=pages&sp_id=391). Hence the division into 4-5-4 or 4-4-5 is not arbitrary. There are many anomalies that occur over the years and how they are handled is determined by this group. Hence the only easy way to handle it is by a look-up table for organizations using the NRF calendar.

Regards



Post #981203
Posted Tuesday, October 2, 2012 5:48 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, August 15, 2013 6:15 PM
Points: 110, Visits: 730
Gagne - I know this post is old but I came across it looking for a 4-4-5 fiscal calendar generator with exactly the criteria you have (Jan1-Dec31 fiscal year, periods end on Friday, etc.) but unfortunately we are still stuck with SQL 2000. Do you have a version of this code that works with SQL 2000?

Thanks,
Dennis



maddog
Post #1367348
Posted Tuesday, October 2, 2012 5:57 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 6:43 AM
Points: 102, Visits: 349
Hi Maddog.

I no longer have access to a SQL 2000 server to test but what's not working in my scrupt ? I reviewed it quickly and I think everything should work besides the table variables but that can replaced wiith temp tables.

Can you run the code and show us what errors you get ?
Post #1367350
Posted Tuesday, October 2, 2012 6:05 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, August 15, 2013 6:15 PM
Points: 110, Visits: 730
Thanks for responding, and so quickly!

The 'dense_rank()' and 'over(partition by' bits in the stored procedure are not functions in SQL 2000, and I don't have use of Analysis Services either unfortunately.

Thanks,



maddog
Post #1367352
Posted Tuesday, October 2, 2012 7:43 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 6:43 AM
Points: 102, Visits: 349
Yes of course, I forgot they were not SQL 2000 functions. I'm gonna check on my machine tomorrow, maybe I still have the 2000 code for this.
Post #1367372
Posted Wednesday, October 3, 2012 5:16 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: 2 days ago @ 7:27 AM
Points: 35,769, Visits: 32,437
Computers have made most date calculations a breeze. I'm amazed that companies and organizations are still stuck with the idea of week-based calculations that require such nuances as ISO weeks, 4-4-5 and 4-5-4 calculations.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1367566
Posted Wednesday, October 3, 2012 7:27 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, August 15, 2013 6:15 PM
Points: 110, Visits: 730
Sounds great, thanks


maddog
Post #1367667
« Prev Topic | Next Topic »

Add to briefcase «««1234

Permissions Expand / Collapse