|
|
Archives of the TeradataForum
Message Posted: Fri, 31 Dec 2010 @ 10:24:42 GMT
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
| |