KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Using %time% with ODBC log

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    KS-Soft Forum Index -> HostMonitor
View previous topic :: View next topic  
Author Message
Guido39



Joined: 17 Sep 2002
Posts: 65

PostPosted: Mon Mar 03, 2003 3:57 pm    Post subject: Reply with quote

When logging to ODBC, the %time% macro comes out as "1/1/1900 2:52:47 PM" when using the datetime datatype in SQL Server. If I use a character type, it comes out correct. Should I be able to use datetime? I will be doing sorts on this field so would prefer to use that.
Back to top
View user's profile Send private message
Marcus



Joined: 18 Nov 2002
Posts: 367

PostPosted: Mon Mar 03, 2003 4:40 pm    Post subject: Reply with quote

Use the %DateTime% macro. It will generate a valid field in SQL.
Back to top
View user's profile Send private message
Guido39



Joined: 17 Sep 2002
Posts: 65

PostPosted: Mon Mar 03, 2003 5:06 pm    Post subject: Reply with quote

I did that too and that works correctly. The reason I'm also logging date and time is so I can do ASP queries by date and then within that query, display just the time since you already know the date. I probably could do some trimming of datetime but figured since time was an option, I would just use that.
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Mon Mar 03, 2003 5:40 pm    Post subject: Reply with quote

The %time% macro comes out as "1/1/1900 2:52:47 PM"? What time format has been set on your system (Control Panel->Regional options->Time format)?
By default HostMonitor uses default system time format. Probably its configured to display date as well? You can change system time format, or you can specify new time format for HostMonitor only using "Use fixed date&time formats" option located on Miscellaneous page in the Options dialog.

Regards
Alex
Back to top
View user's profile Send private message Visit poster's website
Marcus



Joined: 18 Nov 2002
Posts: 367

PostPosted: Tue Mar 04, 2003 3:21 am    Post subject: Reply with quote

It's not Hostmonitor or a system setting. It's SQL which does the conversion from text to datetime format. Just use the %DateTime% macro and you will never run into problems.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    KS-Soft Forum Index -> HostMonitor All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index