Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 24 May 2002 @ 15:37:42 GMT

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

Subj:   Re: Format statement and floating point numbers
From:   John Hall

If the employee number is no larger than 15 digits, then you're back to concatenating 5 zeroes to satisfy the 20-digit requirement:

     sel '00000' || sth_employee_id (decimal(15,0), format '9(15)')
       from aeo_devlworkdb.flat_tlog
       where sth_employee_nbr is not null;

You won't need the CAST to DECIMAL if your sth_employee_id field contains the leading zeroes.

Once again, you can't use FLOAT (even as a CAST). The process of converting any value to a floating value will involve rounding errors for certain numeric values. You can imagine how popular your extract will be if the employee numbers aren't reliable (or accurate).

  <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: 28 Jun 2020