Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2008
    Location
    Denver, CO
    Posts
    44

    Unanswered: Working with NULL date values

    Hi,

    I'm trying to have it so that people can insert null values in a date column in one of my tables, but it keeps putting in 1900-01-01 as the default null value. I tried changing the column to ColumnName DATE DEFAULT NULL, but that didn't work. Is it possible to have it just put a null value in?
    Paul Palubinski

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, of course it's possible

    there must be something else wrong, but it's pretty hard to guess from the information you've supplied

    was your change successful? how are you entering the values? can we see a sample INSERT statement?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Dec 2008
    Posts
    135
    i think ur just passing the value zero to that date column so that it is storing default date
    check this once
    declare @t table(id datetime)
    insert into @t select 0
    insert into @t select null
    select * from @t

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Yes, I'd say the problem is in your application interface. You think you are sending nulls, but it is actually sending zeros. I've seen this many times.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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