Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

on one grid i am displaying sum of values which are based on some criteria

ROUND(SUM(ISNULL(dry.OffHours, 0)) / @DailyWorkingHours,0) aS OffTerritoryDays
which gives me
0.06
0.06
0.06

Now , in other requirement i want to disply sum of all this three values all together
so my expected outcome should be 0.18 but I am getting 0.19 as it is again rounding the values and which makes it 0.19

What I have tried:

I am using for my other table same

ROUND(SUM(ISNULL(dry.OffHours, 0)) / @DailyWorkingHours,0) aS OffTerritoryDays,

which is now giving me 0.19 insted of 0.18

Please suggest
Posted
Updated 11-Apr-16 22:05pm
v2

1 solution

Try :
SQL
SUM(ROUND(ISNULL(dry.OffHours, 0)) / @DailyWorkingHours,0) aS OffTerritoryDays,
 
Share this answer
 
Comments
Torakami 12-Apr-16 4:16am    
seemz to be sum error in syntax of this , saying sum function required only one arguments

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900