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 |
|
shemayb
Posting Yak Master
159 Posts |
Posted - 2008-09-23 : 23:00:29
|
| Hi!Given: Date = 11/10/2005 06:30:00How do i get the hour and minute value in the above given?Funnyfrog |
|
|
jobejufranz
Starting Member
33 Posts |
Posted - 2008-09-24 : 00:41:26
|
quote: Originally posted by shemayb Hi!Given: Date = 11/10/2005 06:30:00How do i get the hour and minute value in the above given?Funnyfrog
CONVERT(VARCHAR,Date,108)If you want to display the result in front-end, I suggest you format the result in front-end and not on your query.Cheers.. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-24 : 00:42:44
|
if you want the hour & minute separately, use datepart() function KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
shemayb
Posting Yak Master
159 Posts |
Posted - 2008-09-24 : 00:52:15
|
| If I want the outpu to be 0630? How will i do that?Funnyfrog |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-09-24 : 01:07:26
|
You should use your Front End application to format the time accordinglyorin SQLreplace(convert(varchar(5), Date, 108), ':', '') KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
shemayb
Posting Yak Master
159 Posts |
Posted - 2008-09-24 : 02:05:24
|
| now i got it..Thank you so much!:)Funnyfrog |
 |
|
|
|
|
|