Archives of the TeradataForum
Message Posted: Fri, 24 May 2002 @ 15:37:42 GMT
| 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)')
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).