> I've always done something like below to handle dates that can be null > in the DB. Was curious if they (MS) every got around to coming up with > a date data-type that can accept null values. Is there a better way?
Don't use NULL dates... it makes all the SQL prone to errors (since comparing anything against NULL is false). Rather, decide what sentinal date value "represents" not-known in the database an use that... for example, use 9999-12-31 23:59:59.997 as the sentinal for date of death and you'll never blow a "is he allive" query... Another voice: http://weblogs.sqlteam.com/mladenp/archive/2007/03/14/60134.aspx -- "Any man who carries a hyphen with him carries a dagger that he is ready to plunge into the vitals of this Republic whenever he gets ready." Woodrow Wilson Marc C. Brooks http://musingmarc.blogspot.com =================================== This list is hosted by DevelopMentor� http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com