Archives of the TeradataForum
Message Posted: Fri, 10 Oct 2003 @ 11:41:51 GMT
Subj: | | CSUM function |
|
From: | | Ferry, Craig |
Does anyone know if the csum function changed between V2R4 and V2R5? I am running the following as part of a larger query (note the csum
at the end). I use it to generate a unique key. In V2R4 when I look at the result set it looks something like this - S200310106403
But in V2R5, if the csum result is over 999 it inserts this into the table - S20031010****
I have tried casting the entire string as CHAR(20) (just like the table field definition) but the same thing happens.
Thanks
Craig
INSERT INTO dss_tables.expense_current_tbl_TEST
SELECT
'S'||
trim(extract(year from '2003/10/10'))||
(CASE
WHEN extract(month from '2003/10/10') < 10
THEN '0'||trim(extract(month from '2003/10/10'))
ELSE trim(extract(month from '2003/10/10'))
END)||
(CASE
WHEN extract(day from '2003/10/10') < 10
THEN '0'||trim(extract(day from '2003/10/10'))
ELSE trim(extract(day from '2003/10/10'))
END)||
trim(csum(1,d.date_invoice))
|