Archives of the TeradataForum 
 
 
Message Posted: Tue, 22 Apr 2008 @ 16:23:22 GMT 
 
  
 
 
 
 
  
|  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 
 
 
 
 
   
 
 |