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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Time seprator

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-02-26 : 07:51:56
Navneet writes "Hi All,
I am developing a web application in ASP.Net. It is a multilingual site. When I try to insert datetime in sqlserver for Italian culture using a sql query it gives me the following error.
***********************************************************
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated. SET DATEFORMAT dmy; INSERT INTO TCE_COURSE_HEADER ( COURSE_VENDOR_ID, COURSE_VERSION, COMPLIANCE, FORMAT, CERTIFICATE, REGISTRATION_START_DT, REGISTRATION_UNTIL_DT, START_DATE, END_DATE, COURSE_WEIGHTAGE, COURSE_MEDIUM, OWNER_USER_ID, CREATOR_ID, CREATION_DATE, MODIFIER_ID, LAST_UPDATED, SCO_COMPLETION_CRITERIA, BASE_LANGUAGE_ID) VALUES ( 6,'',1,0,0,'24/02/2004','07/03/2004','24/02/2004','07/03/2004',100,1,-1,-1,'24/02/2004',0,'24/02/2004 11.22.56',1,26) The 'PR_INSERT' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead.
***********************************************************
I tried to diagnose it and found that the problem is with the time seprator. Sql server only recognizes ":" as time seprator and for Italian culture "." is the time seprator.
Is there any configurations availale in Sql server for specifing the time seprator because for dates it accepts "\" , "." , "-" but for time it only accepts ":" ?"

nfsoft
Starting Member

36 Posts

Posted - 2004-02-26 : 10:46:45
Not a solution but you could just do this...
REPLACE(date_str,'.',':')

This shold be no problem becouse a date is inputed as a string.



Nuno Ferreira
Go to Top of Page
   

- Advertisement -