473,409 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Storing birthday data

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
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
2 2456
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
Nov 23 '05 #2
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
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

51
by: Sandra | last post by:
I was given this problem for extra credit and I am just stuck ! BTW - I am not asking for source code and I am not asking anyone to do my homework as I do want to learn .. I just need a hint or two...
1
by: Claude Alain | last post by:
Hello! We are a small non-profit organisation with about 400 members. We have created a database using Access97 which contains tombstone information on our members, including home adresses and...
2
by: edwin van rutten | last post by:
Hi I have a personal database of all adresses etceteras of personal contacts and want to sort the birthday dates in such a way that I have a chronological list for this years birthdays. The...
7
by: Adrian | last post by:
I hit on this problem converting a VB.NET insurance application to C#. Age next birthday calculated from date of birth is often needed in insurance premium calculations. Originally done using...
9
by: Crirus | last post by:
I have ~200 players on a server... They share the same 512x512 tiles map... Each player have an explored area and a visible area... visible area is given by players's current units and...
0
by: Wolf | last post by:
Hi I am using the outlook add in for vs.net 2005 and outlook 2003. I am creating contacts in outlook from our system The clients want to see only the birthdate's and dont want to be bugged...
5
by: NomoreSpam4Me | last post by:
Hi, i did a search and find the way to get the birthday without the year. My field is yyyy/mm/dd, (birthday). I also have a day field (1 to 31) and a month field. (1 to 12) My problem is: I...
13
kestrel
by: kestrel | last post by:
Sheila and He-Man are twins; Sheila is the OLDER twin. Assume they were born immediately after each other, an infinitesimally small - but nonzero - amount of time apart. During one year in the...
1
by: stilldancin12 | last post by:
Ok so i have to write an application that asks for the users birthday and replies with they day of the week in which he or she is born on, using the java program. This is what I have so far.It gives...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.