Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 03 Sep 2004 @ 06:58:53 GMT

  <Prev Next>   <<First <Prev

Subj:   Re: Generating week dates without sys_calendar
From:   Dieter Noeth

Geoffrey Rommel wrote:

  The ingenuity displayed so far is impressive, but IMHO it is far easier just to create a new table with dates, week numbers, the day of the week, etc.  

Of course, then you can collect stats and tell the optimizer there are only 7 days within a week. Wouldn't it be nice to collect stats on view columns....

  And while we're on the subject, what demented programmer came up with CalBasics?!  

Let me guess...
You're talking about that beautiful astronomical calculation of day_of_calender? Must have been a trainee ;-)

Or do you still remember that nice quarter_of_year bug:

     Q = month_of_year / 4 + 1
     Q1: 1,2,3
     Q2: 4,5,6,7
     Q3: 8,9,10,11
     Q4: 12


  <Prev Next>   <<First <Prev
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023