cancel
Showing results for 
Search instead for 
Did you mean: 

custom script help !

kilcran
Level 3

I have this query, and would like to add a coumn for master server name.

 

SELECT
clientName AS "Client",
lookup_ScheduleType.name AS "Schedule Type",
utcbiginttonomtime(startTime) AS "Start Time",
utcbiginttonomtime(endTime) AS "End Time",
DATEDIFF(mi, utcbiginttonomtime(StartTime), utcbiginttonomtime(EndTime)) AS "Duration (Min)",
filesBackedUp AS "File Count",
(bytesWritten/1024) AS "Size (Kilobytes)"
FROM domain_job
JOIN lookup_ScheduleType
ON lookup_ScheduleType.id = domain_job.scheduleType
WHERE
clientName LIKE '%vcld34gpadhap04%'


ORDER BY utcbiginttonomtime(startTime)

 

This should be easy but im not seeing it!

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

ihimanshu
Level 2
Employee

Try this.

 

SELECT domain_masterServer.friendlyName as "Master",
domain_job.clientName AS "Client",
lookup_ScheduleType.name AS "Schedule Type",
utcbiginttonomtime(domain_job.startTime) AS "Start Time",
utcbiginttonomtime(domain_job.endTime) AS "End Time",
DATEDIFF(mi, utcbiginttonomtime(domain_job.StartTime), utcbiginttonomtime(domain_job.EndTime)) AS "Duration (Min)",
domain_job.filesBackedUp AS "File Count",
(domain_job.bytesWritten/1024) AS "Size (Kilobytes)"
FROM domain_job , lookup_ScheduleType , domain_masterServer
WHERE lookup_ScheduleType.id = domain_job.scheduleType
and domain_job.masterserverid = domain_masterServer.id
and clientName LIKE '%vcld34gpadhap04%'
ORDER BY "Start Time"

View solution in original post

5 REPLIES 5

ihimanshu
Level 2
Employee

Try this.

 

SELECT domain_masterServer.friendlyName as "Master",
domain_job.clientName AS "Client",
lookup_ScheduleType.name AS "Schedule Type",
utcbiginttonomtime(domain_job.startTime) AS "Start Time",
utcbiginttonomtime(domain_job.endTime) AS "End Time",
DATEDIFF(mi, utcbiginttonomtime(domain_job.StartTime), utcbiginttonomtime(domain_job.EndTime)) AS "Duration (Min)",
domain_job.filesBackedUp AS "File Count",
(domain_job.bytesWritten/1024) AS "Size (Kilobytes)"
FROM domain_job , lookup_ScheduleType , domain_masterServer
WHERE lookup_ScheduleType.id = domain_job.scheduleType
and domain_job.masterserverid = domain_masterServer.id
and clientName LIKE '%vcld34gpadhap04%'
ORDER BY "Start Time"

Thank you !

Ok maybe one more question, is there a way that it wont matterr if the server name is in upper or lower case?

Are you trying to filter based on master server name something like = 'MasterServer'.

If yes use Lower() or Upper function for both side of the argument.

also another think i used to be able to add multiple clientname searches but now i can only have one.

 

thanks