SQL Server DateTime Datatype

Results 1 to 3 of 3

Thread: SQL Server DateTime Datatype

  1. #1
    Join Date
    Dec 1969

    Default SQL Server DateTime Datatype

    I just wanted to know if there was a specific way you have to pass a date into SQL Server from a ASP script. <BR><BR>The inserted value as of now enters as: 1900-01-01 00:00:00.000<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default Do an UPDATE or INSERT statement.

    Or use the ADORecordset.AddNew & .Update methods.<BR><BR>How else do you get data into the database?<BR><BR>-Doug

  3. #3
    Join Date
    Dec 1969

    Default You missed the '...'

    When you inserted, you probably did something like this:<BR><BR>INSERT INTO table (someDateField) VALUES( 3/16/2002 )<BR><BR>Yes?<BR><BR>But with no quotes around that date, it is automatically a number. What number? Why 3 divided by 16 and then divided by 2002. In other words, so close to zero as to not matter. And guess what zero is when converted to a date?<BR><BR>Yep. You got it: 1900-01-01.<BR><BR>Try:<BR><BR>INSERT INTO table (someDateField) VALUES( &#039;3/16/2002&#039; )<BR><BR>

Posting Permissions

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