My view would be to store it as a date and use the built in MySQL and PHP
date functions to do the hard work with the calculations for you - may make
life easier by just adding 14 days to a date rather than 14 to a number then
working out if it's a Monday, Tuesday etc ?

On Wed, Jun 23, 2010 at 4:09 PM, Super Steve <[email protected]> wrote:

> I have a need to record an anniversary date with just a day and month
> (year isn't important so I don't need to record it).
>
> I'm using MySQL 5.0.26 and was wondering what the best way is to store
> the anniversary and then do queries on it.
>
> The query I need to do is to select all records that have an
> anniversary date 2 weeks in the future.
>
> Should I split the anniversary date into two numeric fields or somehow
> keep it as one?  Maybe convert it to some sort of "day of year" number
> (what about leap years?)?
>
> I will be using a form to get the anniversary, and also to allow
> editing of the anniversary.  I was thinking of having two select
> lists, one for day (0 - 31) and one for month (Jan - Dec).
>
> Any ideas on the best way to handle this?
>
> --
> NZ PHP Users Group: http://groups.google.com/group/nzphpug
> To post, send email to [email protected]
> To unsubscribe, send email to
> [email protected]<nzphpug%[email protected]>
>

-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to