Re: nvarchar Data type conversion to Datetime
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sat, 18 Jun 2005 17:03:45 +0000 (UTC)
Lloyd S (LloydS@xxxxxxxxxxxxxxxxxxxxxxxxx) writes:
> I am using SQL Server. I have a field that has date data in nvarchar()
> type. I would like to convert the field and data to datetime type. I used
> convert and cast but got an error message saying there was an arithmetic
> overflow. Is there some way to fix this problem and get rid of the
> error. Is this the only way to convert the data in the field from
> nvarchar() to datetime or is there another way.
Supposedly there is data in that column which is not interpretable as
a date according to your current dateformat settings.
SELECT * FROM tbl WHERE isdate(nvarcharcol) = 0
will reveal the culprits.
Also read this: http://www.karaszi.com/SQLServer/info_datetime.asp-
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
.
- References:
- nvarchar Data type conversion to Datetime
- From: Lloyd S
- nvarchar Data type conversion to Datetime
- Prev by Date: nvarchar Data type conversion to Datetime
- Next by Date: installation of mdac 2.81
- Previous by thread: nvarchar Data type conversion to Datetime
- Next by thread: installation of mdac 2.81
- Index(es):
Relevant Pages
|