Storing birthday data

Started by David Garamondover 21 years ago3 messagesgeneral
Jump to latest
#1David Garamond
lists@zara.6.isreserved.com

What would be the more proper way of storing birthday data? It will be
used to send out birthday messages for customers ("Happy 30th birthday,
Sam!"). But the date of birth is not necessarily known (in which case,
we will only send out "Happy birthday, Sam!").

I prefer using the builtin date type instead of three smallints. But I
don't like having to arbitrarily set, say, year 1000 AD or 1 BC to
represent "unknown year".

Any thoughts?

--
dave

#2Björn Lundin
bnl@tiscali.se
In reply to: David Garamond (#1)
Re: Storing birthday data

David Garamond wrote:

What would be the more proper way of storing birthday data? It will be
used to send out birthday messages for customers ("Happy 30th birthday,
Sam!"). But the date of birth is not necessarily known (in which case,
we will only send out "Happy birthday, Sam!").

I prefer using the builtin date type instead of three smallints. But I
don't like having to arbitrarily set, say, year 1000 AD or 1 BC to
represent "unknown year".

Any thoughts?

How about NULL?
/Bj�rn

#3David Garamond
lists@zara.6.isreserved.com
In reply to: David Garamond (#1)
Re: Storing birthday data

Christopher Petrilli wrote:

What would be the more proper way of storing birthday data? It will be
used to send out birthday messages for customers ("Happy 30th birthday,
Sam!"). But the date of birth is not necessarily known (in which case,
we will only send out "Happy birthday, Sam!").

I prefer using the builtin date type instead of three smallints. But I
don't like having to arbitrarily set, say, year 1000 AD or 1 BC to
represent "unknown year".

Well if you make the column nullable, then you can detect that when
you retreive it.

Which column? If I use a single date column and set it nullable, I won't
be able to say "date of month and month is known, but year is unknown".

Anyway, I think I'll go with the single date column way.

You could also, if you don't want that, use a second
column to indicate that it's been set.

--
dave