如何将sql中的时间更改为小时 [英] how to change time in sql to hours

查看:292
本文介绍了如何将sql中的时间更改为小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我已经完成了每个月的总时间..现在我想将这个时间转换成每个月的小时数...有谁能告诉我怎么样在sql转换时间t小时



这是用于总时间的代码

hello

I have done total time for each month ..now i want to convert that time into hours per month...can anyone tell me how to convert time t hours in sql

this is code used for totaltime

CONVERT(TIME, DATEADD(s, SUM(( DATEPART(hh, date) * 3600 ) + ( DATEPART(mi, date) * 60 ) + DATEPART(ss, date)), 0)) AS totaltime





谢谢



thank you

推荐答案

请检查此链接 http://community.spiceworks.com/topic/428514-sql-report-to-display-total-ti me-for-current-month-in-hours [ ^ ]


这篇关于如何将sql中的时间更改为小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆