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.
Author |
Topic |
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2013-09-10 : 05:03:41
|
I need to convert to dateadd Hour 8 to get the current time. Will like to schedule a job to run every hour.How can I apply it in where condition? select dateadd(hour,8,GETDATE()) 0000-0100 0100-0200 0200-0300 ' ' ' ' |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-09-10 : 06:18:12
|
1) Create one table with Time slots as follows:StartTime EndTime0000 01000100 02000200 0300While retrieving data use as follows:SELECT * FROM SourceTableWHERE TimeColumn BETWEEN StartTime AND EndTime--Chandu |
|
|
|
|
|