Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to design recurring events? 1

Status
Not open for further replies.

ETN

Programmer
Jan 27, 2004
33
CA
Hello,

I want to make a little meetings rooms reservations application. I wonder what is the best way to design the database for the case someone wants to book a room for several days or weeks (i.e. 09:00-11:00).

I guess "copying" the reservation multiple times is not the right thing to do because we want to let the user cancel the recursion (like in outlook)

Currently my reservation table looks like this:
Reservation(ID_Res,ID_Room,User_Login,Start_Date,End_Date,Txt_Purpose)

The 2 ways I see I could do it is:
1- Add a field Nb_Times and a field Type (Daily,Weekly)
2- Add a table Reservation_Recursion with the sames fields and when showing the calendar looping through the both tables

I don't like #1 because it need lots of programming to figure out the schedule of each rooms.

#2 seems not bad but I don't think looking into 2 tables for the same kind of info is the best way to do it...

Thank you
 
Add a Parent_Res_ID. If it's a recurring meeting put the first occurence in the Parent_Res_ID. Each apoitment should have it's own record so that a single record can be modified (like in Outlook).

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Thanks it is too easy, I have not thought about this solution..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top