Monday, March 26, 2012

Getting sum for no.of hours

In my database one of my table contain no.of working hours column and the column is taken as nvarchar data is like 8:30,7:20,5:00 this,
problem is how to get total no of working hours, itried with sum(no.of working hours) it is not working ......

For some reason I cant think of an easier method. One way you could do is
split the values based on the ":" and sum the numbers individually. As in sum(8,7,5) and do a sum of minutes (30, 20)..etc and then convert the minutes into hours and add it to the hours later. It does sould a little round about but atleast that should get you started.|||

thanks for ur help ,its working fine...

sorry for late reply

No comments:

Post a Comment