Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Test for current time

Author  Topic 

tleonard
Starting Member

13 Posts

Posted - 2008-10-13 : 12:28:19
I want to create a stored procedure to execute in a continous loop to return current day sales figure. At bottom of loop I want to test to see if current time greater than 9:00 PM and if so, exit the loop. Something like... I know to set @CurrentTime = getdate(). What is correct syntax to test for current time?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-13 : 12:38:14
use DATEPART(hh,getdate()) > 21
Go to Top of Page

tleonard
Starting Member

13 Posts

Posted - 2008-10-13 : 13:22:59
Thanks

tl
Go to Top of Page
   

- Advertisement -