![]() |
|
Archives of the TeradataForumMessage Posted: Mon, 29 Aug 2005 @ 16:41:47 GMT
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
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||