July 10, 2012 at 7:19 am
Hi,
Is anyone faced the same problem. I have a job that runs every day @ 12 am.
When i query the "select h.run_date,h.run_time,run_status,* from msdb.dbo.sysjobhistory h" table the h.run_time returned like 0 or 1.
is it a bug?
Please refer the attachment.
Thanks.
Edited: In GUI job history the time looks fine : Date 7/9/2012 12:00:00 AM
Muthukkumaran Kaliyamoorthy
https://www.sqlserverblogforum.com/
July 10, 2012 at 7:29 am
No, thats right, 0 means midnight, 1 means 1 second past midnight
As its an INT column 000000 shortens down to 0.
July 10, 2012 at 7:35 am
You have to convert the run_date and run_time columns into a meaningful value. Steve Kass provided the following solution to calculate the datetime value from both columns years ago:
CONVERT
(
DATETIME,
RTRIM(run_date)
)
+
(
run_time * 9
+ run_time % 10000 * 6
+ run_time % 100 * 10
+ 25 * duration
) / 216e4
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]
July 10, 2012 at 7:38 am
Thank you Jona and Anthony.
Muthukkumaran Kaliyamoorthy
https://www.sqlserverblogforum.com/
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply