leap years don't just complicate the calucation when a person was born on 
Feb 29 ... even if no one was born on feb 29, answering the question 
"who's birthday is in the next/last X days?" is complicated by needing to 
know whether the current year is a leap year...

: Or have two fields, dayofyear and dayofleapyear, then use the
: right field in the right year. --wunder

...that will certianly work better then the 59.5 approach as long as X is 
always less then 59 ... but it's going to be a pain if X can be 90.

: > If someone's birthday falls on a leap year, in most countries their
: > birthday is considered to be February 28th unless it happens to be a
: > leap year.  You could make the field a float, encode the day number as
: > 59.5, so it will match where it should, and write special handling
: > along these lines:

: >> if you aren't too picky about leap years, the simplest appraoch would
: >> probably be to just index the day of the year they were born on as an
: >> integery ... your query code will have to be a little smart about
: >> moduloing arround the start/end of the year.



-Hoss

Reply via email to