![]() |
|
Archives of the TeradataForumMessage Posted: Sat, 09 Dec 2006 @ 10:59:24 GMT
Try this. This will find if the number of digits is greater than 4 and then finds the 4the decimal.
SEL
CAST(Col AS VARCHAR(10)) AS Dec_Char
,CHARACTER_LENGTH(Dec_Char) AS ChrLen
,CASE WHEN ChrLen > 4 THEN SUBSTRING(Dec_Char FROM (Chr_Len - 5) FOR 1
ELSE 'Number has fewer digits' END DecResult
FROM Table;
Thanks, Vinay Bagare
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||