At 11:49 PM 3/3/2005, Doug Hamilton wrote:

Yes Razzak, that does help, thank you - it was the next piece
of the puzzle to implement and yours is a very succinct solution.

My question was on storing a birthdate without the year.  Some
adults don't care to give their birthyear, so all we have is MM/DD
in DateOfBirthColumn.  For the kids (who aren't so particular), we
want to store MM/DD/YYYY in DateOfBirthColumn so we can determine
their age for placement in classes as well as printing the birthday
list.  So, for the adults who don't give us a birth year, I'm thinking
the best thing is to store something like MM/DD/1000 or MM/DD/0001 or
some obviously bogus year that is easy enough to exclude via WHERE
clauses.  I just have to be careful that I don't print a birthdate
list showing some people born over a thousand years ago, regardless
of how old they might _feel_.


Doug,

In that case, how about (for test purpose):

Define a table HappyBirthdays with the following columns:

01. LastName TEXT 20
02. FirstName TEXT 20
03. MiddleNsme TEXT 20
04. DOBDay INTEGER
05. DOBMonth INTEGER
06. DOBYear INTEGER
07. DateOfBirthColumn DATE =
    
(IFNULL(DOBYear,(RDATE(DOBDay,DOBMonth,1900)),(RDATE(DOBDay,DOBMonth,DOBYear))))

That should give you the DateOfBirthColumn with as real date.

Based upon the criteria above, you can do all kinds of stuff and not to
include those WHERE DOBYear IS NULL.

For birthday purposes, use the logic provided earlier, i.e,:

If you need to know the birthday of all kids, next month, such
as March, regardless of the actual year, try the following:

Example:

SET VAR vMonth INTEGER = (IMON(ADDMON(.#DATE,1)))

SELECT LastName, FirstName FROM tablename WHERE +
(IMON(DateOfBirthColumn)) = .vMonth

That should give you the list of all kids with their birthday in March.

Have fun!

Very Best R:egards,

Razzak.



Reply via email to