Expand|Select|Wrap|Line Numbers
- SELECT table.excav_id,
- table.RecordID,
- table.indx_dpr,
- table.tons_bkt,
- table.tons_trk
- FROM table
- WHERE (((table.Record_Date)>=#8/28/2008 6:15:00#))
- ORDER BY table.excav_id, table.RecordID, table.indx_dpr,table.Record_Date;
The way to identify the total segment for a single load would be to compare the value in the previous record "tons_trk" to the current record "tons_trk" and if it is less than, start a new load_#. I just do not know how to write the sql query to accomplish this.
Expand|Select|Wrap|Line Numbers
- RecordID excav_id indx_dpr tons_bkt tons_trk load_#
- 1923367 1 1 54 54 1
- 1923368 1 2 56 110 1
- 1923369 1 3 54 165 1
- 1923370 1 4 48 213 1
- 1923371 1 5 39 252 1
- 1923372 1 1 68 68 2
- 1923373 1 2 63 131 2
- 1923374 1 3 58 189 2
- 1923375 1 4 55 243 2
- 1923376 1 1 65 65 3
- 1923377 1 2 67 133 3
- 1923378 1 3 69 202 3
- 1923379 1 4 61 263 3
- 1923380 1 1 34 34 4
- 1923381 1 2 0 34 4
- 1923382 1 3 0 34 4
- 1923383 1 1 72 72 5
- 1923384 1 2 60 132 5
- 1923385 1 3 52 184 5
- 1923386 1 4 67 252 5
- 1923387 1 2 62 62 6
- 1923388 1 3 58 121 6
- 1923389 1 4 56 177 6
- 1923390 1 5 54 231 6