Seth Petry-Johnson wrote:
> Hello all, I am re-designing a database driven calendar application.  I want
> to support recurring events (such as a weekly meeting) and I was looking for
> a few design suggestions.  Basically, I want a user to be able to enter an
> event and specify that it happens on a repeating schedule: every week, once
> a month, etc.  When a user views the calendar I want these to appear, but I
> do not want to have to enter a record into the database for each occurrence
> of that event.  In other words, if an event happens weekly I want to have
> one database record, not a separate record for each week of each month of
> each year, etc.

It depends a lot on what database you use. If it has date functions it 
should be reasonably easy to insert just any date in one field, an 
interval identifier (ii) in the next and number in the third. The 
interval identifier is something like "d" for day, "w" for week, "m" for 
month etc. Next you just run a DateDiff("ii", date, now()) perform a MOD 
and if the result is 0 you have a hit.
But this does probably not scale well in databases since indexing this 
is virtually impossible.

Jochem

______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to