Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 cast? convert?? replace??? UGGHH!!!!

Author  Topic 

d-e-f
Starting Member

8 Posts

Posted - 2012-05-24 : 17:18:43
hello everyone, i have column containing elapsed time in the following format:

0h:22m:36s
0h:38m:7s
0h:01m:54s
1h:00m:36s

I need to round these values to the number of minutes down to a tenth:

22.6
38.1
1.9
60.6

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-05-24 : 19:25:07
[code]
datediff(second, 0, replace(replace(replace(timecol, 'h', ''), 'm', ''), 's', '')) / 60.0
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -