How would I go about representing appointment dates that could either occur once, multiple times, or indefinitely?
For example, I'd like to know how an application like Microsoft Outlook stores its appointment/meeting date information.
It is does it dynamically. Only one appointment exists with a recurrence value. You could do the same thing, and when you display your user interface you generate the recurring appointments first then load the non reoccurring.
Appointment Table
Appointment ID unique key
Appointment Time timestamp
Appointment Recurrence Indicator
O = One Time, D = Daily, K = Weekdays Only, W = Weekly,
M = Monthly, L = Last Working Day of Month, etc
Appointment Description
etc
Recurrence Table
Recurrence Code (as above O,D,K,W,M,L, etc)
Recurrence Time Window (0 for O, 24 for D, etc.)
Recurrence Calculation
etc
Next Appointment = dateadd (timestamp + recurrence factor)
-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
Recurrence Time Window is a codeindicating when the next recurring appointment will occur.
Calculation is not always used. For instacnce, if Weekly recurrence, then NEXT_APPT = DATEADD(LAST_APPT,7) {using Oracle's DATEADD function.
If the recurrence is last Friday of day of month, there would be some sort of special calculation you would need to do. Example:
WHILE DayOfWeek <> '/Friday'
WHILE Month = CurMonth
etc
-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.