Solved

How to list jobs from last 24 hours in a CommServeDB query?

  • 5 August 2022
  • 4 replies
  • 41 views

Userlevel 1
Badge +4

CommServe DB query

==================

SELECT startdate
   ,clientname
   ,idataagent
   ,instance
   ,backupset
   ,subclient
   ,backuplevel
   ,jobstatus
   ,jobid
FROM CommcellBackupInfo
WHERE jobstatus = 'Failed to Start'
and backuplevel = 'Synthetic Full'
and iDataAgent = 'Virtual Server' 
order by jobid desc ;

 

I was this list to contain  only the jobs from last 24 hours, how to add the time range in this sql query.

 


 

icon

Best answer by Jos Meijer 5 August 2022, 11:23

View original

4 replies

Userlevel 1
Badge +3

Honestly I have to try it to be sure.

i want to use a check box to modify a where clause in a workflow.

even if it doesnt work this gives me a good idea what to try next. Thanks @Jos Meijer 

Userlevel 6
Badge +14

something like this?

 

CASE
WHEN condition_1 AND condition_2 THEN result_1
ELSE result_2
END

 

Badge

Jos, Meier you might know this. 
What’s the simplest way to achieve conditional and statements in a query.

google fails me.

Userlevel 6
Badge +14
SELECT startdate
   ,clientname
   ,idataagent
   ,instance
   ,backupset
   ,subclient
   ,backuplevel
   ,jobstatus
   ,jobid
FROM CommcellBackupInfo
WHERE jobstatus = 'Failed to Start'
and backuplevel = 'Synthetic Full'
and iDataAgent = 'Virtual Server'
and startdate >= DATEADD(day, -1, GETDATE())
order by jobid desc ;

 

Reply