﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / PROBLEM WITH DATE CONVERSION / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 14:27:28 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: PROBLEM WITH DATE CONVERSION</title><link>http://www.sqlservercentral.com/Forums/Topic1400722-391-1.aspx</link><description>[quote][b]lonhanner (12/27/2012)[/b][hr]Yes the data came from ACCESS. I imported to sql. Is their anyway I can convert the "UP_DATE" Column to the sql date type. If so could you give me an example query to do this.ThanksLon[/quote]Not sure what datatype it is now or if everything in it will convert correctly but...[code]alter table MyTablealter column MyColumn datetime[/code]</description><pubDate>Thu, 27 Dec 2012 13:24:03 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: PROBLEM WITH DATE CONVERSION</title><link>http://www.sqlservercentral.com/Forums/Topic1400722-391-1.aspx</link><description>Yes the data came from ACCESS. I imported to sql. Is their anyway I can convert the "UP_DATE" Column to the sql date type. If so could you give me an example query to do this.ThanksLon</description><pubDate>Thu, 27 Dec 2012 12:54:43 GMT</pubDate><dc:creator>lonhanner</dc:creator></item><item><title>RE: PROBLEM WITH DATE CONVERSION</title><link>http://www.sqlservercentral.com/Forums/Topic1400722-391-1.aspx</link><description>[quote][b]lonhanner (12/27/2012)[/b][hr]I have a column called "UP_DATE". When the code below trys to read "UP_DATE" I get the following riders.UP_DATE = CDate(reader("UP_DATE").ToString)error. Conversion from string "" to type date is not valid. It looks as its tring to convert time. here is the data I get. riders.UP_DATE #12:00:00 AM#. Anyone have a solution to how to fix this column. When i query the data in SQL server manegement it  displays the date fine. I have other date fields and they convert ok.[/quote]What is this code and what does #12:00:00 AM# mean? That looks like data from Access or something.The error message is however pretty self explanatory. Whatever is reading your table it is getting an empty string in reader("UP_DATE") which can't be cast to a datetime object in many languages. t-sql will convert an empty string to 1/1/1900 but .NET will throw an exception when parsing a date from an empty string.</description><pubDate>Thu, 27 Dec 2012 12:34:29 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>PROBLEM WITH DATE CONVERSION</title><link>http://www.sqlservercentral.com/Forums/Topic1400722-391-1.aspx</link><description>I have a column called "UP_DATE". When the code below trys to read "UP_DATE" I get the following riders.UP_DATE = CDate(reader("UP_DATE").ToString)error. Conversion from string "" to type date is not valid. It looks as its tring to convert time. here is the data I get. riders.UP_DATE #12:00:00 AM#. Anyone have a solution to how to fix this column. When i query the data in SQL server manegement it  displays the date fine. I have other date fields and they convert ok.</description><pubDate>Thu, 27 Dec 2012 11:51:11 GMT</pubDate><dc:creator>lonhanner</dc:creator></item></channel></rss>