> not sure. i also felt that was a potential threat and can afford to have
> to answer to the "why didn't these people get that email?" question.
> this solution just doesn't seem robust enough. :(

SELECT DATE_ADD('<date>', INTERVAL 6 MONTH) + INTERVAL 45 DAY
Input Date      Output Date
2007-02-25      2007-10-09
2007-02-26      2007-10-10
2007-02-27      2007-10-11
2007-02-28      2007-10-12
2007-03-01      2007-10-16
2007-03-02      2007-10-17
2007-03-03      2007-10-18
2007-03-04      2007-10-19

I ran those through. emails wouldn't be sent for people with an input date of:
Feb 29 2007, Feb 30 2007, and Feb 31 2007
But those days don't exist, so you wouldn't miss anyone.

Sometimes you would send emails for two different dates on the same day. But,
again, no emails are lost or duplicated.

2007-03-29      2007-11-13
2007-03-30      2007-11-14      two on same day
2007-03-31      2007-11-14
2007-04-01      2007-11-15
...
2007-04-29      2007-12-13
2007-04-30      2007-12-14      skip a day
2007-05-01      2007-12-16
2007-05-02      2007-12-17
...

See http://tetratech.info/oddcss/sql_interval.php
for a comprehensive list. You have to look for the skip/same day yourself, but
they occur around the 14th in this case (+45 day) But every input date gets 1
output date, not 0 or 2 or 3 or 4.

Orson

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to