Nov 2, 2005 #1 Antzz Programmer Jan 17, 2001 298 US Hi Folks, Any idea on how to assign a null/empty value to a DateTime data type? If this is not possible then what is the alternative Thx and appreciate it. A
Hi Folks, Any idea on how to assign a null/empty value to a DateTime data type? If this is not possible then what is the alternative Thx and appreciate it. A
Nov 2, 2005 #2 MasterRacker Active member Oct 13, 1999 3,343 US I ran into the same problem here: thread732-1090257 Basically you need to pick a date value that will represent null since .NET DateTimes are not nullable. Jeff [purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day "The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me Upvote 0 Downvote
I ran into the same problem here: thread732-1090257 Basically you need to pick a date value that will represent null since .NET DateTimes are not nullable. Jeff [purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day "The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me
Nov 2, 2005 #3 JurkMonkey Programmer Nov 23, 2004 1,731 CA DateTime.MinValue is a good way to check for a bad date. If a date is supposed to be null, I set it to MinValue. Upvote 0 Downvote
DateTime.MinValue is a good way to check for a bad date. If a date is supposed to be null, I set it to MinValue.
Nov 2, 2005 #4 MasterRacker Active member Oct 13, 1999 3,343 US That's what I ended up doing as well. Actually, I ended up with 2 "special dates". NullDate = DateTime.MinValue ZeroDate - 01/01/1990 (place wasn't around before then) This allowed me to distinguish between an empty date and "the beginning of time". Jeff [purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day "The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me Upvote 0 Downvote
That's what I ended up doing as well. Actually, I ended up with 2 "special dates". NullDate = DateTime.MinValue ZeroDate - 01/01/1990 (place wasn't around before then) This allowed me to distinguish between an empty date and "the beginning of time". Jeff [purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day "The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me