I need to determine duration of a request by when the request went from Milestone_ 3 to Milestone_8 (but if Milestone_8 is null use Milestone_7) minus weekend minutes.
But I also need to find the days when a request was On Hold and subtract those days from the duration (not counting weekend days it was On Hold), note: a request can go from On Hold to Open several times.
So times for when a request was On Hold are located in the comments table (of all places), there are three different times
- WHEN LOG_COMMENTS LIKE '%status changed from open to on hold%' OPEN_OH
- WHEN LOG_COMMENTS LIKE '%status changed from on hold%' OH_OPEN
- WHEN LOG_COMMENTS LIKE '%Status changed from On Hold to Close%' OH_CLOSE
I have gathered all the required fields/columns from 3 different tables into one table because I thought it would be easier, but I’m struck at this point.
Expected results would be UNIVERSL_ID, Duration (minus weekend days), Days On Hold (not counting weekend days), and Total Days (Duration minus On Hold)
Can you help? Thx