TSM backup results

select cast(entity as char(18)) Node, -
 cast(activity as char(6)) Task, -
 date(start_time) Date, -
 time(start_time) Time, -
 successful -
from summary -
 where activity='BACKUP' -
  and ( -
   (day(START_TIME)=day(current_timestamp)-1 and hour(start_time)>=18) -
  or -
   (day(START_TIME)=day(current_timestamp) and hour(start_time)<8) -
      ) -
order by START_TIME

the resualt of this script is start from 00:00:00 until 7:00

i need that the result will be from last day start in 8:00 until next day on 7:00

like between 31.5.2015 8:00 until 01.06.2015 7:00
TSMILAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

woolmilkporcCommented:
To extend the time span from yesterday 8:00 until today 7:59 and to take the month change into account change the date/time selectors to

...
    (date(START_TIME)=date(current_timestamp-1 day) and hour(start_time)>=8) -
...
   (date(START_TIME)=date(current_timestamp) and hour(start_time)<8) -

...

Here is the whole thing:

select cast(entity as char(18)) Node, -
 cast(activity as char(6)) Task, -
 date(start_time) Date, -
 time(start_time) Time, -
 successful -
from summary -
 where activity='BACKUP' -
  and ( -
   (date(START_TIME)=date(current_timestamp-1 day) and hour(start_time)>=8) -
  or -
   (date(START_TIME)=date(current_timestamp) and hour(start_time)<8) -
      ) -
order by START_TIME

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage Software

From novice to tech pro — start learning today.