开发者

onlne attendance system calculate average time

开发者 https://www.devze.com 2023-02-15 00:34 出处:网络
i am developing online attendance system. i have table t_attendancedetailsin sql server. i have two columns day on attendance and day off attendance..

i am developing online attendance system. i have table t_attendancedetails in sql server.

i have two columns day on attendance and day off attendance..

for example

10-20-2010 09:20:oo ...

i want to calculate average time at which person开发者_如何学C mark his attendance ..and average time at which person mark off his attendance after duty off..


SELECT
CAST(AVG(CAST( onattendance AS FLOAT )) AS DATETIME),
CAST(AVG(CAST( offattendance AS FLOAT )) AS DATETIME)
FROM t_attendancedetails

This thread may help,

http://www.bennadel.com/blog/175-Ask-Ben-Averaging-Date-Time-Stamps-In-SQL.htm

query taken from there.

0

精彩评论

暂无评论...
验证码 换一张
取 消