Results 1 to 3 of 3

Thread: Time Seprator

  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Unanswered: Time Seprator

    Hi All,
    I am developing a Web Application in ASP.Net. When my Italian clients try to use this application. We got the following exception while inserting datetime in SQL Server.
    ***********************************************
    "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 diagnosed the problem and found that the problem exists because sql server asks for ":" as time seprator and for Italian culture the time seprator is ".".
    Please help me in finding that how can we specify the time seprator in sql server.

  2. #2
    Join Date
    Jul 2003
    Location
    Penang, Malaysia
    Posts
    212
    don't know about time separator, but a workaround could be:

    before u insert into your SQL query,
    use replace command either in ASP.net or in SQL itself

    e.g.
    REPLACE('24/02/2004 11.22.56','.',':')
    Patrick Chua
    LBMS ( Learn By My Self) NPQ ( No paper Qualification )

  3. #3
    Join Date
    Feb 2004
    Posts
    2

    Thanks

    Hi Patrik,
    Thanks for the solution.
    This will leads us to a massive code change across the application.
    I was looking at a global solution so that I need not change my whole code.

    Please give me a solution so that I can do it at a single point.
    I was also looking for any SQL Server configuration settings.

    Regards,
    Navneet

    Originally posted by Patrick Chua
    don't know about time separator, but a workaround could be:

    before u insert into your SQL query,
    use replace command either in ASP.net or in SQL itself

    e.g.
    REPLACE('24/02/2004 11.22.56','.',':')

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •