First thing's first:
Where is the data coming from, and under what parameters? Is the equipment sending stamps when it starts and when it stops? Or intermittently based on what event? Without knowing this, you can't process your data. For example, if it sends a start time, some intermittent times, and an end time, then the equipment ran for 2 hours on 1/2/2006, not 3 hours.
Also, will it always reliably send a start and stop time?
Also, can the equipment ever run for many days at a time continously?
Your best bet is to query for the high and low on each day and then do a DateDiff(), but if it can go for weeks at a time, this will need to be tweaked.
Also, how can you tell which is a start and which is a stop time? Can you have the equipment report differently to a start time and stop time column?
HTH
mmcdonal
|