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 |
anupalavila
Yak Posting Veteran
56 Posts |
Posted - 2008-09-27 : 06:03:48
|
Hai, what query can I use to get the hour part from the datetime 2008-09-27 09:30:00.000 so that the query returns 9Thanks and Regards Anu Palavila |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2008-09-27 : 06:14:07
|
Use datepart function.when you say 9, what do you mean ? month or hour ? |
 |
|
anupalavila
Yak Posting Veteran
56 Posts |
Posted - 2008-09-27 : 06:16:32
|
I mean to return the hour partThanks and Regards Anu Palavila |
 |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2008-09-27 : 06:20:28
|
SELECT DATEPART(hour, '2008-09-27 09:30:00.000')http://msdn.microsoft.com/en-us/library/ms174420.aspx |
 |
|
anupalavila
Yak Posting Veteran
56 Posts |
Posted - 2008-09-27 : 06:39:10
|
Thankyou very much Afrik for your valuable answerThanks and Regards Anu Palavila |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-27 : 06:57:24
|
Did you refer links i posted for your other article. It contains all these infohttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=111519 |
 |
|
|
|
|