cheshire_smile
Registered User.
- Local time
- Today, 04:24
- Joined
- Jul 1, 2011
- Messages
- 12
I have a table with a stataus of a terminal collected every minute (time collection can be changed to other time spans). I need a VBA script that will collect the time stamp stamps based on their status or change in status.
Sample Table:
If the status changes from Up one minute to Down the next, it records the time stamp as Start time or Down Time, and if it changes back to up, it records it as stop time or Up Time.
The results should looke like this:
I've Tried doing this with SQL but I think this is one of those times where VBA would be more efficient at this.
Sample Table:
Code:
Terminal_ID--Time_Stamp-------Status
2-------6/19/2011 00:01:00-------up
2-------6/19/2011 00:02:00-------up
2-------6/19/2011 00:03:00-------Down
2-------6/19/2011 00:04:00-------Down
2-------6/19/2011 00:05:00-------Down
2-------6/19/2011 00:06:00-------Down
2-------6/19/2011 00:07:00-------Up
2-------6/19/2011 00:08:00-------Up
2-------6/19/2011 00:09:00-------Up
2-------6/19/2011 00:10:00-------Down
2-------6/19/2011 00:11:00-------Up
2-------6/19/2011 00:12:00-------Up
2-------6/19/2011 00:13:00-------Up
2-------6/19/2011 00:14:00-------Up
2-------6/19/2011 00:15:00-------Up
If the status changes from Up one minute to Down the next, it records the time stamp as Start time or Down Time, and if it changes back to up, it records it as stop time or Up Time.
The results should looke like this:
Code:
Terminal_ID--Down_Time---------Up_Time
2-------6/19/2011 00:03:00--6/19/2011 00:07:00
2-------6/19/2011 00:10:00--6/19/2011 00:11:00
I've Tried doing this with SQL but I think this is one of those times where VBA would be more efficient at this.