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 |
vipinjha123
Starting Member
45 Posts |
Posted - 2012-06-05 : 03:58:09
|
Dear Friend,i have a table attendence tablehaving 2 column in_date,out_datei need exact time diffrence of both tablesupposeindate-2012-05-03 08:57:05.000oudate-2012-05-03 20:12:42.297which giving me 12hrsbut actual time diffrence is 11 hrs 15 minplese help me to get exact time diffrnceregards,Vipin jha |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2012-06-05 : 04:32:49
|
outdate-indate==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-06-05 : 10:32:31
|
[code]SELECT CONVERT(varchar(8),DATEADD(ss,DATEDIFF(ss,in_date,out_date),0),108) FROM table[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2012-06-05 : 10:54:23
|
what's wrong with SELECT in_date - out_date FROM tableDo yoou want it to the nearest minute, 15 minutes, server precision?==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|