Converting to Date error?

Results 1 to 2 of 2

Thread: Converting to Date error?

  1. #1
    Join Date
    Dec 1969

    Default Converting to Date error?

    I am trying to update dates to one of my tables, I keep receiving an error from SQL server7 stating: "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value"<BR>I don&#039;t understand why as it is saving dates in another table without any problems, all dates are set to datetime format

  2. #2 Guest

    Default RE: Converting to Date error?

    Show some code and we may be able to sort out the problem,<BR><BR>However, I think that you may need to use the CDate function to make sure that your date variable is properly converted. The problem could arise because dates are in a format other than US date(mm/dd/yy). For example I have had a problem because I am in australia, where we use dd/mm/yy format. In that format if I enter 31st of January (ie 31/1/2000), it would work okay, but if I entered 10th Jan (ie 10/1/2000), then I would get Oct 1. Then Bill Wilkinson showed me how to use the CDate function in conjunction with Session.LCID (locality code), and the problem was fixed.

Posting Permissions

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