Zack_Axapta2012
Zack_Axapta2012

Reputation: 23

rounding SQL decimal zero and then sum

i need two decimal places for zero , now i have only number zero , should i use decimal function ? but i don't how to integrate to my previous round and sum .

     round(sum(NUS),2) AS NUS

Upvotes: 1

Views: 5140

Answers (2)

ngrashia
ngrashia

Reputation: 9904

USE TO_CHAR with corresponding format modifier to get the required output.

For more info on Number Format Models, refer here.

Select to_char(round(sum(NUMS),2), 'fm9999999.00') 
REQUIRED_OUTPUT from TESTDATA1;

Refer Sample Output Fiddle here:

Upvotes: 1

Decoded
Decoded

Reputation: 159

 1.00 * sum(NUS) AS NUS 

will do it

Upvotes: 1

Related Questions