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 |
|
chsrikanth
Starting Member
6 Posts |
Posted - 2011-12-29 : 01:18:54
|
| I have the following fields in my table.UserName DateTime Actionabc 22/1/2011 23:45 xyzdef 23/1/2011 10:00 pqrI need to know the time difference between two records. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-12-29 : 01:25:19
|
you will only have 2 records in the table ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
chsrikanth
Starting Member
6 Posts |
Posted - 2011-12-29 : 01:33:00
|
| I have many records.I have to calculate the time difference between two consequent records. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-12-29 : 01:37:19
|
How do you define which 2 record are consecutive ? Do you have a identity column in the table that can determine the sequence ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
chsrikanth
Starting Member
6 Posts |
Posted - 2011-12-29 : 02:07:51
|
| Yes I have identity column. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-12-29 : 02:11:26
|
quote: Originally posted by khtan How do you define which 2 record are consecutive ? KH[spoiler]Time is always against us[/spoiler]
So how will you do that ?please post more of the sample record and the expected result KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|