• Erland Sommarskog (9/22/2013)


    I repeat what I said in my previous post:

    Generally, when you ask this question like this, it helps if you post:

    1) CREATE TABLE statements for your table(s).

    2) INSERT statements with sample data, enough to cover all relevant cases.

    3) The desired result given the sample.

    Your posts are very confusing. The expected output is presented as a time slot and a count, and then you start talking about hostnames reapparing. Yeah, those two jobs may have the same host, but they are not overlapping, so what does that matter? And even if they were overlapping, why would that matter?

    Your screenshot tells me that you have a datetime column, and that you may be be interesting in the dates as well. Then again, I don't know. For all I care, you may want to lump all jobs that ran at 12:30, no matter the day, into a single slot.

    And what is the output supposed to mean? The jobs that were running at that point in time? (So that a job that ran from 12:01 to 12:29 would not be counted?)

    All this boils down to: if you don't know what you want, nor will I know. And if you know what you want, you need to tell me.

    sorry about, I only know the simple english....

    this is backup report of our company

    "hostname" is the server name

    start time is start backup time

    but some server will have file level and DB level backup at same day...

    so will have more then one entry in a day

    we want to know how many backup jobs in process at every 30 mins. (from 8p.m. to 8a.m.)

    to do the vertex buffer.