hi ., i need (logintime in one table and fixed working hours is eg:9 but a employee login at 10 o clock the delay hours is 1 hour . fixed working hours is saved in one table as companytime(tablename) and employee login time is saved in another table as logintime (table) i need to compare both the table and need the delay time )
Eg: Logintime is 10
fixed time is 9
----------
delay is 1 hour
-----------------
using asp.net using c#
How to compare time and find the delay time?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


SenthilkumarRank #387 · 6.5K reputationPosted Apr 11, 2012, 11:20 PM EDT
Usually you can get the time difference by using this.
SELECT DATEDIFF(hh,GETDATE()-1,GETDATE()) AS [Difference]
I do not know about your table structure. But i assumed like this. You can change the condition according to your requirement.