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 |
|
deve
Starting Member
1 Post |
Posted - 2006-08-31 : 08:17:55
|
| Hi,I have a table with 5 fields in it.1) RecordId, PK2) UserId, varchar3) LoginDate, datetime4) LogoutDate,datetime5) SessionTime,intI would like to calculate the time difference(in Mins) between field 3 and 4.Any advice on what is the best practice to do it?Thanks in advance,Deve |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-08-31 : 08:22:22
|
| SELECT Table1.*, DATEDIFF(second, LoginDate, LogoutDate) / 60.0FROM Table1Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|