I am trying to convert a char(24) field to datetime but it does not work, please help?
A sample data would be:
SELECT top 1 convert(datetime, '2014-03-05 17:03:18.518') from CounterData
and obviously it works. However, when I replace the date and time data with the field name which has the data type of char(24), it fails:
select top 1 convert(datetime, CounterDateTime) from CounterData
(The above query also should return '2014-03-05 17:03:18.518')
The error message is:
Conversion failed when converting date and/or time from character string.
How can I make this work easily without managing the data char by char? By the way, I am using MS SQL 2008.
Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied?
You can use SQL Server Initialize from Backup…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message. In the To field, type your recipient's fax number @efaxsend.com.
You can even send a secure international fax — just include t…