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 |
|
jogin malathi
Posting Yak Master
117 Posts |
Posted - 2007-07-30 : 05:30:58
|
| select datediff(ss,In_time,Out_time)select datediff(ss,'23:22:11','00:40:50')But out time is as 12/6/2007 00:40:50and in time is as 11/6/2007 23:22:11when iam trying to get the date diff it gives the negitive value as Column-------------81681how can i get the actual differenceMalathi Rao |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-30 : 05:37:32
|
That is the actual difference in SECONDS because you have set the DATADIFF to calculate seconds.And when you do not provide the DATE part, SQL Server assumes the date of January 1, 1900.Try to add the date part too...set dateformat dmyselect datediff(ss,'11/6/2007 23:22:11', '12/6/2007 00:40:50') E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|