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 |
|
lbeese
Starting Member
24 Posts |
Posted - 2008-02-28 : 16:10:10
|
| I have a log table that displays the history of the status of an entity and the date the status changed. member_id | modification_date | status I wish to find the differences between datetime values in different rows of the modification_date column. I would need the amount of time between whatever the next sequential time was for the member. I would also need to know the status change in that time. I don't know how to do this with just one date column.Any assistance is appreciated. Thank you. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-28 : 16:13:39
|
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-29 : 05:42:24
|
| something likeselect t1.member_id,t1.modification_date,t1.status,datediff(hour,t1.modification_date,t2.modification_date) as time_diff from table t1 inner join table t2on t1.modification_date<t2.modification_dateMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|