Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 25 Mar 2008 @ 14:45:53 GMT


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


Subj:   Re: Alias field into table
 
From:   Mutsch, Joerg

I agree to Victor.

But what you could do is to join a calendar table (whether your own or the Table calendar from sys_calendar) and qualify on the current data to get the current month based on the Date you run the query.

E.G.

     select field1 as "month"
     from table a
     inner join sys_calendar.calendar  c (or your own)
     on a.field1 = year_of_calendar||(month_of_year (format '99'))
     where calendar_date=current_date

Or just qualify on the current Date

     select field1 as "month"
     from table a
     where a.field1 = current_date (format 'YYYYMM')  (char(6))  (depending
     on your Fieldtype)

Hope this helps.

Joerg



     
  <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: 27 Dec 2016