View previous topic :: View next topic |
Author |
Message |
Guido39
Joined: 17 Sep 2002 Posts: 65
|
Posted: Mon Mar 03, 2003 3:57 pm Post subject: |
|
|
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 |
|
|
Marcus
Joined: 18 Nov 2002 Posts: 367
|
Posted: Mon Mar 03, 2003 4:40 pm Post subject: |
|
|
Use the %DateTime% macro. It will generate a valid field in SQL. |
|
Back to top |
|
|
Guido39
Joined: 17 Sep 2002 Posts: 65
|
Posted: Mon Mar 03, 2003 5:06 pm Post subject: |
|
|
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 |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12801 Location: USA
|
Posted: Mon Mar 03, 2003 5:40 pm Post subject: |
|
|
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 |
|
|
Marcus
Joined: 18 Nov 2002 Posts: 367
|
Posted: Tue Mar 04, 2003 3:21 am Post subject: |
|
|
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 |
|
|
|