How to get the time for a given datetime
value?
I have a datetime
in database like this:
2010-09-06 17:07:28.170
and want only the time portion:
17:07:28.170
Is there a function for that or something?
How to get the time for a given datetime
value?
I have a datetime
in database like this:
2010-09-06 17:07:28.170
and want only the time portion:
17:07:28.170
Is there a function for that or something?
In case of SQL Server, this should work
IN SQL Server 2008+
Assuming the title of your question is correct and you want the time:
Edited to include millisecond.
Try this
http://msdn.microsoft.com/en-us/library/bb677243.aspx
Just to add that from SQL Server 2008, there is a TIME datatype so from then on you can do:
Might be useful for those that use SQL 2008+ and find this question.