Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

default date?

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I've noticed that when you declare a column of the datetime datatype in SQL it puts in a default value of 1900-01-01 00:00:00.000
Is there a simple way that I can check and see if the date is this value and if so, not display it in my text field?
Is there something like an 'isDefault(boolean)' method that I can use to determine that, or is it more complicated than that?
Thanks for any help!
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jennifer
I don't know about a test for default but could you make the column so it accepts null and then specify null as the default, then you'd only have to test for null??...
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I thought. Just thought I'd double check and make sure I wasn't missing something.
Thanks for the help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic