Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SYSAlert Last_occurenence_time Int value?

Author  Topic 

rikleo2001
Posting Yak Master

185 Posts

Posted - 2008-05-16 : 09:45:43
Guys,

Quick one, how can I convert following sysalert values into valid date time

Last_occurenecne_date , Last_occurenence_time as datetime?

Any quick way to do it please?

Many Thanks

SQL 2000 SP3

Thanks in advance.



SKR

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 2008-05-16 : 10:44:29
Here's a quick and dirty hint in a direction that will work.

However, Peso has some better methods that he's posted. I'd look around for those for more permanent and elegant solutions.


This only adds the hour to the date, but you get the idea.

select dateadd(hh,convert(int,left(convert(varchar(8),last_occurrence_time),2)),convert(varchar(8),last_occurrence_date)) from msdb..sysalerts where last_occurrence_date <> 0


An infinite universe is the ultimate cartesian product.
Go to Top of Page
   

- Advertisement -