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 |
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2011-04-13 : 05:49:51
|
| hello everybody, how do i get only hh:mm:ss from the time '14:50:25.3310000'.i.e i need only '14:50:25'.thanx in advance |
|
|
Ranjit.ileni
Posting Yak Master
183 Posts |
Posted - 2011-04-13 : 06:48:48
|
| Check it onceSELECT CONVERT(VARCHAR(8),GETDATE(),108) AS HourMinuteSecond -- 16:17:40SELECT CONVERT(VARCHAR(8),'14:50:25.3310000',108) AS HourMinuteSecond -- 14:50:25--Ranjit |
 |
|
|
raghuveer125
Constraint Violating Yak Guru
285 Posts |
Posted - 2011-04-13 : 06:48:55
|
| SELECT substring ( '14:50:25.3310000',1,8)Raghu' S |
 |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2011-04-13 : 08:19:56
|
quote: Originally posted by Ranjit.ileni Check it onceSELECT CONVERT(VARCHAR(8),GETDATE(),108) AS HourMinuteSecond -- 16:17:40SELECT CONVERT(VARCHAR(8),'14:50:25.3310000',108) AS HourMinuteSecond -- 14:50:25--Ranjit
Thank Raghu...that worked like a charm |
 |
|
|
|
|
|