I need to know how to compare Two timings in SQL Server
Here,
User will pass the @StatusTime as parameter for my Procedure
& i ll get the current time from my local system as follows.
Declare @CurrentTime datetime
set @CurrentTime=GetDate()
Now i need to compare these two?
Thanks in Advance


SenthilkumarRank #387 · 6.5K reputationPosted Apr 7, 2012, 12:24 AM EDT
Please find the stored procedure of date comparision.
I have tested in sql server. Same you can do it from the front end.
MuthuMari MRank #5,738 · 288 reputationPosted Apr 6, 2012, 11:00 PM EDT
The DATEDIFF() function returns the time between two dates.
pls refer this for samples
http://demiliani.com/blog/archive/2006/01/19/3384.aspx
http://www.w3schools.com/sql/func_datediff.asp
thanks.
If this post helps you, then mark as "Correct Answer"