Results 1 to 4 of 4

Thread: sql server error

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    33

    Angry sql server error

    I am currently having a very strange error. I use the following query in my ASP.net program and for a couple of days ago it worked perfect. But then out of nowhere I get this system 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.INSERT INTO Forms (formxml,formfile,formcheck,formindat) VALUES ('rapautomatisering.xml','rapautomatisering7.xml','N','25-06-2003');

    what the hell happened ?

    It seems that the formindat value in my querie causes the problem, but in the table the datatype o fthe field is 'datetime'. And it worked a couple of days ago! help

    best regards,

    Krol

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    The date is formatted as "dd-mm-yyyy"....
    SQL Server wants the date as "mm/dd/yyyy"... so it tries to interpret 25 as the month.... since it couldn't it thinks that the date is invalid.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2003
    Posts
    33

    thANKS

    Man,

    Am I glad You responded to my thread.
    This explains why it worked earlier.

    thanks a lot!

    Krol

  4. #4
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375
    Try putting this in any SQL query where there are dates

    'SET DateFormat DMY --Rest of query here'

    Cheers
    MarkusJ

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