Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 22 Apr 2008 @ 16:23:22 GMT


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


Subj:   Re: Small function in teradata
 
From:   Michael Larkins

Sreenivasa:

The only thing wrong with what you wrote was that in Teradata you must tell it the length of a CHAR.

     > > CAST(MOD(EXTRACT(YEAR FROM CURRENT_DATE),4)  AS CHAR(1)) = 0
             /* should be '0' if using CHAR to prevent another conversion */

However, it would be much more efficient and faster to not convert it to a CHAR as in the following:

     WHERE MOD(EXTRACT(YEAR FROM CURRENT_DATE),4) = 0

Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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