Results 1 to 9 of 9

Thread: Datetime error 80040e07 on Update statement (DWUD)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    The Netherlands
    Posts
    96

    Datetime error 80040e07 on Update statement (DWUD)

    I have a problem with updating a field which hold a datetime. When I use <%=NOW%> for inserting a datetime into my MS SQL database everything goes well....When I try to update this by using <%=NOW%> it returns the following error...

    Code:
    [Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to 
    a datetime data type resulted in an out-of-range datetime value.
    I have been trying to convert and format the time in many many different ways for a few days now....does anyone know how to solve this problem?
    Last edited by Chrissie; Jan 17th, 2003 at 04:03 AM.

  2. #2
    Hyperactive Member Anglo Saxon's Avatar
    Join Date
    Mar 2002
    Location
    Durham, UK
    Posts
    259
    What are the regional settings for the SQL database?

    '16/1/03' in American format (mm/dd/yy) would be out of range, but not in British/English (dd/mm/yy)...


    --
    Anglo Saxon

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    The Netherlands
    Posts
    96
    datetime shows up as '17-1-2003 8:44:48' in the DB

    strange thing is when inserting it works but updating it won't...
    Last edited by Chrissie; Jan 17th, 2003 at 04:19 AM.

  4. #4
    Hyperactive Member Anglo Saxon's Avatar
    Join Date
    Mar 2002
    Location
    Durham, UK
    Posts
    259
    and what does the date value show up as when you do a response.write Now() ??

    The other thing you could do is set the field to a default value of getdate() , you may still have problems on seraches which had dates as the conditional statements though....

    --
    Anglo Saxon

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    The Netherlands
    Posts
    96
    Code:
    update dbo.Bla set IP = '156.345.1.65,ChangedBy = '5',LastChange = '1/17/2003 10:24:33 AM',SystemStatus = 'not active' where CallID = 40
    The query shows up like above when debug printing it to the browser

    I've been playing around with SQL Analyser....it accepts a date Formatted as '17-1-2003 10:24:33 AM'

    so I think my question changes a little...how to format the date to get the above date...
    Last edited by Chrissie; Jan 17th, 2003 at 04:30 AM.

  6. #6
    Hyperactive Member Anglo Saxon's Avatar
    Join Date
    Mar 2002
    Location
    Durham, UK
    Posts
    259
    Originally posted by Chrissie
    update dbo.Bla set IP = '156.345.1.65,ChangedBy = '5',LastChange = '1/17/2003 10:24:33 AM',SystemStatus = 'not active' where CallID = 40


    Notice anything about the date??

    --
    Anglo Saxon

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    The Netherlands
    Posts
    96
    Yeah just noticed it..see my above post..

  8. #8
    Hyperactive Member Anglo Saxon's Avatar
    Join Date
    Mar 2002
    Location
    Durham, UK
    Posts
    259
    This should give you some ideas :

    http://www.aspfaq.com/show.asp?id=2260

    Happy reading!

    --
    Anglo Saxon

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    The Netherlands
    Posts
    96
    Thanks got it working now...really strange sometimes it gives the error...sometimes not...

Posting Permissions

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



Click Here to Expand Forum to Full Width