logitestus (5/7/2014)
My apologies. That row shouldn't be returned as 1200.0 but as 2500.0. I can completely understand the confusion.The logic is where document type (doc_type column) is 'S' for 'Starting', 'E' for Ending; grab the associated 'A' record.
Grab it under what circumstances, and do what with it?