Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Tue, 14 Jan 2003 @ 23:21:09 GMT

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

Subj:   Re: History table monthend logic
From:   krishnan

This is based on my understanding of the problem.

The view can be something like

select extract(month from calendar_date-1)||'/'||extract (year from
calendar_date-1) as month_ending,
from hst_tbl a,
     sys_calendar.calendar b
where b.calendar_date > a.plan_start_dt
  and b.calendar_date <=  a.plan_stop_dt
  and b.day_of_month=1
  and b.calendar_date > '1990-01-01' and b.calendar_date <= date
order by accnt,calendar_date

P.S. where '1990-01-01' can be a date which is set based on the reporting year.

  <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: 28 Jun 2020