How would I be able to extract the time part of a DateTime field in SQL? For my project I have to return data that has a timestamp of 5pm of a DateTime field no matter what
Note that from MS SQL 2012 onwards you can use FORMAT(value,'format')
FORMAT(value,'format')
e.g. WHERE FORMAT(YourDatetime,'HH:mm') = '17:00'
WHERE FORMAT(YourDatetime,'HH:mm') = '17:00'