Question
DB: 'proper' way of handling null fields and dates?
I need to store a date in a table. The date might be
anything, including
non-existent.
Is it better to store the date in one field, and check to see if it's null,
or is it better to use two fields...one for the date, and the other to
'flag' records that shouldn't have a date.
Obviously the former will work, but you always have to deal with the
sometimes messy issue of properly checking for nulls and properly inserting
nulls. Having a separate bit field seems like a cleaner way to handle it,
but I'm not sure if that's a faux paux to have that extra field when,
technically, I don't REALLY need it.
-Darrel
--
=================================================================
Win prizes searching google:
http://www.blingo.com/friends?ref=hM72-GU3FWzMFnTqhv-2GE1FNtA
non-existent.
Is it better to store the date in one field, and check to see if it's null,
or is it better to use two fields...one for the date, and the other to
'flag' records that shouldn't have a date.
Obviously the former will work, but you always have to deal with the
sometimes messy issue of properly checking for nulls and properly inserting
nulls. Having a separate bit field seems like a cleaner way to handle it,
but I'm not sure if that's a faux paux to have that extra field when,
technically, I don't REALLY need it.
-Darrel
--
=================================================================
Win prizes searching google:
http://www.blingo.com/friends?ref=hM72-GU3FWzMFnTqhv-2GE1FNtA
