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 |
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-01-26 : 11:52:23
|
| Dear All,I want diffrence in MM:SS.For example 30.10.Please suggestFrom_Date To_Date2009-12-23 18:04:54.000 2009-12-23 18:04:57.0002009-12-23 21:28:17.000 2009-12-23 21:28:25.0002009-12-24 08:27:27.000 2009-12-24 08:42:28.0002009-12-24 09:59:17.000 2009-12-24 09:59:18.0002009-12-24 10:48:07.000 2009-12-24 13:10:24.0002009-12-24 11:53:20.000 2009-12-24 13:38:11.0002009-12-24 13:03:23.000 2009-12-24 13:48:33.000 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-26 : 11:55:06
|
| [code]SELECT CONVERT(varchar(8),DATEADD(ss,DATEDIFF(ss,From_Date,To_Date),0),108) FROM table[/code] |
 |
|
|
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2010-01-26 : 12:07:02
|
| Thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-01-26 : 12:12:45
|
welcome |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2010-01-26 : 13:58:40
|
This also does it, if From_Date and To_Date are datatype DATETIME.select convert(varchar(8),To_Date-From_Date,108) CODO ERGO SUM |
 |
|
|
|
|
|