Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 10 Oct 2003 @ 11:41:51 GMT


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


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))


     
  <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: 15 Jun 2023