Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vipinjha
Starting Member
21 Posts |
Posted - 2012-03-15 : 07:11:55
|
Dear All,I am getting this issueThe conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value.in my table event_time is char i want to convert it into datetime datatypeplease suggest the best possible way..Reagrds,Vipin jhaVipin jha |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2012-03-15 : 07:21:20
|
Which format do you use for the date value in the nvarchar column?See CAST & CONVERT in Books Online. N 56°04'39.26"E 12°55'05.63" |
 |
|
vipinjha
Starting Member
21 Posts |
Posted - 2012-03-15 : 07:33:02
|
i used both but not workingVipin jha |
 |
|
MPhoenix
Starting Member
4 Posts |
Posted - 2012-03-15 : 07:37:15
|
Hi vipinjha,Could you put the code of the conversion please ? |
 |
|
rajarajan
Starting Member
48 Posts |
Posted - 2012-03-15 : 12:56:11
|
declare @TestDateValue nvarchar(50)set @TestDateValue = '01/01/05'select cast(@TestDateValue as datetime) as NewTestDateTimeTry this |
 |
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2012-03-15 : 13:17:05
|
Do you have an example of an input value that is actually failing? The error message is indicating that the converted value is outside the allowed range (e.g. Year < 1753).=================================================Men shout to avoid listening to one another. -Miguel de Unamuno |
 |
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|