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 |
nick604r
Starting Member
3 Posts |
Posted - 2006-12-13 : 12:47:44
|
I've got a query that I need help with. This is a simplified version of the table I have.sellerID, orderID, time1, time2, time3, time41, 1b1, 11:30 11:35 11:40 11:451, 1b2, 11:50 11:55 12:00 12:051, 1b3, 12:10 12:15 12:20 12:252, 1c1, 11:20 11:25 11:30 11:352, 1c2, .... and so onWhat I want is a datediff between time4 of the previous OrderID to time1 of the current orderID within the same sellerID.What I want is the following outputsellerID, orderID, timeDif1(time1 current row-time4 previous row), timeDif2(time2-time1), TimeDif3(time3-time2), timeDif4(Time4-time3)1, 1b1, (11:30- null), (11:35-11:30)5mins, (11:40-11:35)5mins, (11:45-11:40)5mins1, 1b2, (11:50-11:45*previous row)5 mins, (11:55-11:50)5 mins, ...Any help would be appreciated!! THanks |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-13 : 13:05:40
|
I think you mean1, 1b1, 15mins, 5mins, 5mins, 5minsright?Peter LarssonHelsingborg, Sweden |
 |
|
nick604r
Starting Member
3 Posts |
Posted - 2006-12-13 : 14:08:59
|
Sorry I made a mistake in my post, please reread the edited version |
 |
|
|
|
|
|
|