Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 29 Aug 2005 @ 16:41:47 GMT


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


Subj:   Re: Problem with with Decimal field in Fast Export
 
From:   Fachtna O Donovan

Hi Raj,

You could try something like the following

     SELECT
     Sum(zeroifnull(field1))    (DECIMAL(9,4),FORMAT '99999.9999') (CHAR(10))

     FROM
     Table1
     WHERE
     field2 = '123'
     Group By field3;

This will give you an answer set like the following

     00125.0000
     00327.5000
     03239.5000
     00255.0000
     64033.0000
     00010.0000

If you want to suppress the leading and training zeros you can use Z in the format statement

eg

     Sum(zeroifnull(field1))    (DECIMAL(9,4),FORMAT 'ZZZZZ.99') (CHAR(10))

Hope this helps,

Fachtna



     
  <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