I'm using SQL server 2012. The query below returns the current time, I'm wanting it to return the time that the jobs actually took place, any help would be appreciated.
SELECT InstanceName AS Instancename,
Jobname AS OptimiseJobs,
CONVERT(varchar(20),CONVERT(date, CONVERT(varchar(8), RunDate), 112),105) AS Date,
(SELECT ltrim(right(convert(varchar(25), getdate(), 100), 7))) AS Time
FROM exampletable WHERE jobname = 'System: Database Optimise'
order by OptimiseJobs