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
 Where Datetime just need time

Author  Topic 

giszzmo
Starting Member

29 Posts

Posted - 2014-11-15 : 19:59:06
From a datetime column I just want to look at the time using the Where clause, for example:
select *
from sys.tables
where modify_date >= '17:00:00.000'

But this doesn't work. Later, I will search elsewhere in another database and look at blocks of time, but I'm not sure how to get the time only. If anyone could point me in the right directions. Thanks!

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-11-16 : 02:36:57
[code]convert(time, modify_date) >= '17:00'[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

giszzmo
Starting Member

29 Posts

Posted - 2014-11-16 : 09:43:24
That works, thank you!
Go to Top of Page
   

- Advertisement -