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.
精彩评论