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-06-06 : 23:27:33
|
how can i get time which is more than 6 hours?my date format as below:16:25:0017:10:0019:15:0020:20:0021:25:00 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-06-06 : 23:31:22
|
what do you mean exactly ?what is the expected result ? KH[spoiler]Time is always against us[/spoiler] |
|
|
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2013-06-06 : 23:40:16
|
select time, ... from tableA, i get result as below:time16:25:0017:10:0019:15:0020:20:0021:25:00i would like to schedule a job to only get 6 hours ahead time.select time from tableA where time > 6 ? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-06-06 : 23:59:36
|
[code]where [[time] > convert(varchar(8), dateadd(hour, 6, getdate()), 108)[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2013-06-07 : 00:12:33
|
is not working..when i run this select convert(varchar(8), dateadd(hour, 6, getdate()))it appear: Jun 7 2 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-06-07 : 00:20:27
|
missed the style. Edited. KH[spoiler]Time is always against us[/spoiler] |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-06-07 : 00:21:48
|
have you also consider the situation when cross over to midnight ?How would you want to handle it ? KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|
|
|