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 |
|
kneel
Starting Member
36 Posts |
Posted - 2007-09-19 : 05:12:52
|
| Hello All,I am trying to insert birthdate "15/05/1981 10:45:14" into Birthday field from table. But I am receiving errror as followsThe conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.The statement has been terminated.Does anybody know, how can I insert Or update this date?Thanks in advance--kneel |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-09-19 : 05:17:47
|
| Add below statement before inserting date:SET DATEFORMAT DMYHarsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Ballu
Starting Member
1 Post |
Posted - 2007-09-19 : 05:20:12
|
| hi just use this peice of codeINSERT INTO table_name(birthdate)VALUES(to_date('15/05/1981 10:45:14' ,'fmdd/mm/yyyy hh:mi:ss'); |
 |
|
|
kneel
Starting Member
36 Posts |
Posted - 2007-09-19 : 05:34:40
|
| Thanks Harsh,you solved my problem--kneel |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-09-19 : 05:42:38
|
You are not using MICROSOFT SQL Server, are you? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-09-20 : 03:14:06
|
quote: Originally posted by Ballu hi just use this peice of codeINSERT INTO table_name(birthdate)VALUES(to_date('15/05/1981 10:45:14' ,'fmdd/mm/yyyy hh:mi:ss');
FYI, this is MS SQL Server Forum and not ORACLE Also you should always express dates in YYYYMMDD HH:MM:SS formatMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|