J
Jeff Gaines
I am writing an app in C# which keeps my diary appointments in an Access
12 DB. Accessing one off appointments is fine but I have to do a lot of
calculations in respect of repeat appointments.
If I have a weekly appointment that started on 1 Jan 2002 and I want to
find out if it should be displayed today I loop through the record adding
7 to the start date until the date is => than the beginning of the current
month. I them start another loop and create temporary records for each day
of the current month until the date is > than the last day of the month.
That gives me a list of records including the date on which the
appointments occur in the current month. It works but it is a bit slow and
will get slower as time goes on because it will have to loop for longer.
Is there a better or 'classic' way of keeping recurring appointments in a
DB that would cut down the work involved in the calculations? I could have
a linked table that contains future appointment dates but I would have to
decide how far to extend it.
I would appreciate any thoughts or guidance.
12 DB. Accessing one off appointments is fine but I have to do a lot of
calculations in respect of repeat appointments.
If I have a weekly appointment that started on 1 Jan 2002 and I want to
find out if it should be displayed today I loop through the record adding
7 to the start date until the date is => than the beginning of the current
month. I them start another loop and create temporary records for each day
of the current month until the date is > than the last day of the month.
That gives me a list of records including the date on which the
appointments occur in the current month. It works but it is a bit slow and
will get slower as time goes on because it will have to loop for longer.
Is there a better or 'classic' way of keeping recurring appointments in a
DB that would cut down the work involved in the calculations? I could have
a linked table that contains future appointment dates but I would have to
decide how far to extend it.
I would appreciate any thoughts or guidance.