Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 31 Dec 2010 @ 10:24:42 GMT


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


Subj:   Odd case with Dates
 
From:   MARIA JOSEFA RODRIGUEZ POSADA

Hi everyone,

We are in Teradata 12.00.0317 and we are facing the next very odd case:

This two statements would provide with the same answear, isn t it? But the thing is that they don4t and we have no idea why not.

     SELECT
     MIN(fec_dia), MAX(fec_dia)
     FROM DWH_PROD.DWH_DIA
     WHERE
       EXTRACT(YEAR FROM fec_dia) >= (EXTRACT(YEAR FROM DATE))-1
       AND fec_dia= (EXTRACT(YEAR FROM DATE))-1
       AND fec_dia


The table DWH_DIA has every day of the years from 1988 to 2020:

     CREATE SET TABLE DWH_PROD.DWH_DIA ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT
          (
           fec_dia DATE FORMAT 'YY/MM/DD',
           cod_fecha CHAR(8) CHARACTER SET LATIN NOT CASESPECIFIC,
           id_semana INTEGER,
           id_dia_de_semana INTEGER,
           des_dia_de_semana VARCHAR(9) CHARACTER SET UNICODE NOT CASESPECIFIC,
           des_semana VARCHAR(35) CHARACTER SET LATIN NOT CASESPECIFIC,
           id_semana_anyo INTEGER,
           id_mes INTEGER,
           id_anyo SMALLINT,
           es_festivo_palau VARCHAR(2) CHARACTER SET UNICODE NOT CASESPECIFIC,
           num_dia_natural INTEGER,
           num_dia_laboral INTEGER)
     PRIMARY INDEX ( fec_dia );

Any idea what4s going on?


Regards



     
  <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