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 |
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2010-03-11 : 01:05:43
|
| oracle query want in sqlset @insertQuery1 = @insertQuery1 + 'to_date(''' + to_char(to_date(@APPOINTMENTDATE,'mm-dd-yyyy'),'dd-MON-yyyy') + ''',''dd-MON-yyyy''),' |
|
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
Posted - 2010-03-11 : 01:28:29
|
| I'm not Oracle expert,have you explain the scenario?Senthil.C------------------------------------------------------[Microsoft][ODBC SQL Server Driver]Operation canceledhttp://senthilnagore.blogspot.com/ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-03-11 : 01:40:24
|
without knowing your full query, i guess . . . set @insertQuery1 = @insertQuery1 + '''' + convert(varchar(8), convert(datetime, @APPOINTMENTDATE, 103), 112) + '''' KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2010-03-11 : 02:04:59
|
| giving eception like The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.mine APPOINTMENTDATE is a varchar field |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-03-11 : 02:10:52
|
quote: Originally posted by rajasekhar857 giving eception like The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.mine APPOINTMENTDATE is a varchar field
that means your date string cannot be converted to datetime. Either it is not in the specified format or the date is not valid.Check your data KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
rajasekhar857
Constraint Violating Yak Guru
396 Posts |
Posted - 2010-03-11 : 02:15:37
|
| then what to do then.need to change query |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-03-11 : 02:20:13
|
quote: Originally posted by rajasekhar857 then what to do then.need to change query
check your data.select *from sometablewhere isdate(thecol) <> 1 KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|
|
|