Results 1 to 6 of 6

Thread: DATETIME BUG 1/1/1900

  1. #1
    Join Date
    Dec 1969

    Default DATETIME BUG 1/1/1900

    Does anyone have an actual answer to this problem? Is there a way to no have SQL Server insert 1/1/1900 into a field through an Update Statement?

  2. #2
    Mike Shaffer Guest

    Default RE: DATETIME BUG 1/1/1900

    What &#039;bug&#039; are you talking about? Have you tried this:<BR><BR>INSERT INTO table (dtfield1) VALUES (&#039;1/1/1900&#039;)<BR><BR>or this:<BR><BR>INSERT INTO table (dtfield1) VALUES (&#039;12:34:56 PM&#039;)<BR><BR><BR>?? Both of these insert 1/1/1900 just fine. Is it possible you&#039;re trying to use a 2-digit year (e.g. &#039;1/1/00&#039;) to accomplish what you want? If so, that is your problem.<BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Same problem too

    I&#039;ve the same problem too.

  4. #4
    Join Date
    Dec 1969

    Default Need to read the question again

    I think you get the wrong translation

  5. #5
    Mike Shaffer Guest

    Default RE: Need to read the question again

    Ahh... I guess the word &#039;no&#039; was meant to be &#039;not&#039;? You&#039;re right, that tripped me up.<BR><BR>

  6. #6
    vijaya krishna Guest

    Default RE: Same problem too

    When ever in your table if the date field is set to accept <BR>default value, if you don&#039;t specify the date then it inserts the<BR>1/1/1900. <BR><BR>to get around this in your update statement add this command<BR><BR>update (table name)<BR>set (date field name) = getdate()<BR><BR>Getdate() is a standard function that comes with SQL Server. It will insert the current date to the table. If you don&#039;t wont<BR>any dates to be inserted when you update, go the design mode <BR>of the table and delete the default value for that column

Posting Permissions

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