Re: [SQL] Iterate and write a previous row to a temp table?

2007-07-06 Thread Bob Singleton
chester c young wrote: --- Bob Singleton <[EMAIL PROTECTED]> wrote: Revisiting a Time In Status query I received help on - I'm trying to narrow down a subset of data I return for analysis. Given a statusLog as entityId, statusId, timestamp that might look som

[SQL] Iterate and write a previous row to a temp table?

2007-07-03 Thread Bob Singleton
eague suggested a temp table, but I'm unsure how to iterate until I pass the startTime and then write the _previous_ and all subsequent rows to a temp table, stopping when I pass the endTime parameter. Any hints? Thanks! Bob Singleton ---(end of

Re: [SQL] calculate time diffs across rows with single timestamp

2007-06-13 Thread Bob Singleton
Rodrigo De León wrote: On Jun 13, 11:17 am, [EMAIL PROTECTED] (Bob Singleton) wrote: Any suggestions on how I can build a result set that would return ASSET 001 AAA 1:00 (1 hour) ASSET 001 BBB 0:10 (10 minutes) ASSET 001 CCC 0:08 (8 minutes) ASSET 001 DDD {difference between

[SQL] calculate time diffs across rows with single timestamp

2007-06-13 Thread Bob Singleton
First post - please pardon if I'm posted to the wrong group. I have a table 'statuslog' type varchar NOT NULL id varchar NOT NULL status varchar datetime timestamp NOT NULL Example data type id status datetime ASSET 001 AAA 2007-06-08 13:42:00.00