Groups | Blog | Home
all groups > sql server programming > october 2005 >

sql server programming : help with proc



raghu veer
10/27/2005 10:16:02 PM
i wrote a procedure which calculates how many minutes a person is late to the
office on a particular day
what is the best method for converting it to calculate the minutes late for
the
Chandra
10/27/2005 10:51:01 PM
Hi Raghu

You can sum up all the minutes and show it as a monthly late.

just see if this helps you:
SELECT
NAME, SUM( DATEDIFF(mi, timearrived, officetime ) ),
datepart(month,timearrived)
FROM ATTENDANCE
GROUP BY NAME, datepart(month,timearrived)

please let me know if you have any questions

--
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---------------------------------------



[quoted text, click to view]
R.D
10/28/2005 2:46:02 AM
Raghu
use datediff(m.date1,date2) in query
date1 or date1 is stored using getdate() default so that the time is also
stored in databse
--
Regards
R.D
--Knowledge gets doubled when shared


[quoted text, click to view]
R.D
10/28/2005 2:49:07 AM
I mean
use datediff('mi'.date1,date2) in query
--
Regards
R.D
--Knowledge gets doubled when shared


[quoted text, click to view]
AddThis Social Bookmark Button