I have the following query:
select name, employeenumber, dateadd(day,dat ediff(day,0,dat e),0) as dateonly,(cast (sum (ontime) as decimal (10,2))) as minutes into scratchpad2
from scratchpad1
where date between '10/3/2010' and '10/10/2010'
group by employeenumber, name ,dateadd(day,da tediff(day,0,da te),0)
order by employeenumber asc
that rounds to the nearest minute, but my data results look like this:
8245 36.965166 .000000 36.965166
8247 10.292000 .000000 10.292000
8295 29.162833 .000000 29.162833
8378 21.346000 .000000 21.346000
8389 13.414333 .000000 13.414333
8428 29.329666 .000000 29.329666
8433 16.928833 .000000 16.928833
8442 10.647500 .000000 10.647500
8451 13.567500 .000000 13.567500
8455 23.935166 .000000 23.935166
what I would like is to have the sums rounded to the nearest minute with only 2 decimal places instead of the 6 that I have. Can someone please assist?
So for example, this line
8245 36.965166 .000000 36.965166
would be
8245 36.97 .000000 36.97
Thank you
Doug
select name, employeenumber, dateadd(day,dat ediff(day,0,dat e),0) as dateonly,(cast (sum (ontime) as decimal (10,2))) as minutes into scratchpad2
from scratchpad1
where date between '10/3/2010' and '10/10/2010'
group by employeenumber, name ,dateadd(day,da tediff(day,0,da te),0)
order by employeenumber asc
that rounds to the nearest minute, but my data results look like this:
8245 36.965166 .000000 36.965166
8247 10.292000 .000000 10.292000
8295 29.162833 .000000 29.162833
8378 21.346000 .000000 21.346000
8389 13.414333 .000000 13.414333
8428 29.329666 .000000 29.329666
8433 16.928833 .000000 16.928833
8442 10.647500 .000000 10.647500
8451 13.567500 .000000 13.567500
8455 23.935166 .000000 23.935166
what I would like is to have the sums rounded to the nearest minute with only 2 decimal places instead of the 6 that I have. Can someone please assist?
So for example, this line
8245 36.965166 .000000 36.965166
would be
8245 36.97 .000000 36.97
Thank you
Doug
Comment