Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Best Default "Value" for DateTime column

Curious which is better, NULL or 1/1/1900
0
cat4larry
Asked:
cat4larry
  • 3
  • 2
2 Solutions
 
Scott PletcherSenior DBACommented:
It depends.

Do you want to automatically ignore missing dates or not?

If you do, NULL is better; if not, 1/1/1900 might be better.
0
 
Surendra NathTechnology LeadCommented:
As per the design perspective,
it should always be NULL, no default value should be put in that place...

As you see if NULL is the default value, then the application can be programmed to ask the user or prompt the use to enter that date.
but if a default value is put in that place, then it may not, not only that NULL's are specifically designed for this purpose in the database.
0
 
cat4larryAuthor Commented:
What becomes difficult is that the table (and its data) will be used in all sorts of ways.  So I'm just looking for a general "start with this" kind of advice.  I can always modify the nature of the data later if I find it isn't working.  Understand?  So back to my original question is it better in general to leave it NULL or 1/1/1900

Hope I'm making sense.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Surendra NathTechnology LeadCommented:
if that is the case, then use 1/1/1900 as this will not throw any error in the application code, where the sloppy application developers have not handled errors.
0
 
cat4larryAuthor Commented:
My thoughts as well.  Just wanted to verify with someone else.

Thanks
0
 
Surendra NathTechnology LeadCommented:
if that answers your question, please close this by awarding the points
thanks Surendra
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now