Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Determine time elapased by hour Expand / Collapse
Author
Message
Posted Saturday, November 02, 2013 5:42 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 9:12 AM
Points: 1,651, Visits: 5,195
brad.mason5 (11/1/2013)
Monster Maghoul thank you for sharing! This is awesome now I just need to understand what is going on here. This guy will perform well under load too!


You are most welcome.

It's really quite simple in terms of "how it works".

The link from Tally (the hours in a day) to your data is where the "hour of the day (n)" falls between the start and end time in your data.

This gives us every data row for each hour, then it is simply a CASE of working out how much of that hour each start/end pair has consumed and SUMming them up.


MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1510852
    Posted Wednesday, November 06, 2013 9:22 AM
    SSC Journeyman

    SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

    Group: General Forum Members
    Last Login: Wednesday, November 06, 2013 9:19 AM
    Points: 91, Visits: 264
    Hi Guys,

    Thanks all for your input. I suppose the MM solution is as close as we are going to get to "eloquent", adn certainly beats mine !!

    Thanks again.

    Matt
    Post #1511923
    « Prev Topic | Next Topic »

    Add to briefcase ««12

    Permissions Expand / Collapse