Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Sat, 08 Oct 2000 @ 01:41:00 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Functions of dates!
From:   Sam Mosley

I know there have been a lot of posts on this, but I think the following is a better approach:

select max(day_of_month)
from sys_calendar.calendar
where year_of_calendar = whatever year you are interested in
and month_of_year = whatever month you are interested in;

This is much more straight forward than the calculations we used to have to do.

One comment on sys_calendar. It consists of a 1 column table with 4 views built on top of it. Each view adds more of the calendar data. Since you can't collect statistics on the derived columns, or build indexes on them, you may want to create a table that looks like the view and insert into it from the view. From then on use your table. Collect statistics, and build indexes as needed by your processing.

Have fun with lots of other nice data in the calendar!

Sam Mosley
VLDB Systems, Inc.

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