Reffering to the following post..<BR><BR><BR><BR>The recordset that i have is designed with the following fields<BR><BR>RefNo<BR>ReservedDate<BR>ReservedDur ation<BR>BookingDate<BR>BookingDuration<BR><BR>The record can either contain a reserved date without a booking date - This will cause the cells to be shaded Green<BR><BR>Or they can contain reserved date and BookingDate - If this is the case then the cell will be shaded Red. (Even though the reservedDate exist, bookingDate precedes ReservedDate. If a booking date exist then the booking duration is used to calculate the number of days to be shaded.<BR><BR>I am not sure if this is the best design but i am thinking to do the following. (Please advice where appropriate)<BR><BR>Create two recordSets<BR><BR>rs1 and rsTemp &#039;Both will contain the same records but one of them is temporary<BR><BR>variable<BR> CurrentDate = the date we are displaying<BR> index = 1 <BR> tempdate <BR><BR><BR>&#039; Start drawing cells<BR>while not end of rs1 <BR> if rs1("BookingDate") = currentDate then<BR> shade current cell Red<BR> else<BR> if rs1("reservedDate") = currentDate then<BR> shade the cell Green<BR> While not end of rsTemp<BR> Go to first record of rsTemp<BR> if duration on current record is &#062; 0 then<BR> while index &#060; duration then<BR> if dateAdd(d, 1, (rsTemp("BookingDAte"))) = currentDate &#039; Add one day and compare if its = currentDate<BR> OverWrite current Cell to Red<BR> increment index<BR> repeat the while loop<BR> move to next record of rsTemp<BR> end if<BR> move to next record of rs1<BR> repeat the loop<BR><BR>Any advice? <BR><BR>As you can see i am only checking the other dates only if i draw a green cell, this is because there is no need to check the other dates if the current cell is red. This is because red overpowers Green. <BR><BR>Am i going the right way or am i doing it completely wrong? Any advice, ideas welcome..<BR><BR>Thanks<BR><BR><BR><BR><BR> <BR> <BR><BR><BR><BR><BR><BR><BR><BR>"Moshe Solomon" &#060;; wrote in message news:OznJ0oScBHA.1064@tkmsftngp07...<BR>The first thing you need to do is get a recordset that contains a computed column called something like "enddate". You calculate its value using the values in startdate and duration. I&#039;m not sure what SQL function it might be in Access, but in SQL Server it is DATEADD. The recordset should contains all the events for the current month.<BR> <BR>To get a list of all events for a given day, use the filter property of the recordset. Define the sort type, so that the results appear in the same order everytime.<BR> <BR>Instead of shading an entire cell for an event, shade just the background for the event name text. You can place the event name in a DIV and define a css class for it.<BR> <BR><BR>Dini wrote in message &#060;#8wCqxRcBHA.1980@tkmsftngp02&#062;...<BR>Hel lo again,<BR><BR>After days of ASP programming i have managed to put together a calendar that<BR>works just as i wanted it to. But now i am thinking of adding a new feature<BR>to it and i need help on the design aspects of the calendar.<BR><BR>Basicly the original calendar just displays event of all the dates in a<BR>specified month. If there is an event on a specific date, then that cell is<BR>shaded. The dates (table cells holding the date) can be either shaded red or<BR>green depending on a value in the database.<BR><BR>This all works fine because all it does is to check every date in the<BR>database, get its refference number and display it on the ASP page in the<BR>colour required.<BR><BR>For example if the refferenceNo is prefixed with R then the cell is RED.<BR><BR>Now here is my problem.<BR><BR>Each Record in the Database is actually an event. At the moment the calendar<BR>only displays single day events.<BR><BR>I would like to introduce multiple days events, this means that..<BR><BR>A single event can have the dates 02/03/02, 03/03/02, 04/03/02 and any other<BR>date. This means that all the cells containing these dates must be shaded.<BR>But then what would happen if another event starts of on 03/03/02. Do you<BR>see the problem?<BR><BR>How do i show this, considering the fact that the only way to know that the<BR>record is a multiple event is by checking a field named &#039;Duration&#039; Which<BR>contain the number of days of the event. Somehow i have to calculate the<BR>current date with this field.<BR><BR>I am thinking to shade the table cells as they are read in the calendar. Eg<BR><BR>Do while not end of month<BR>Read first event (assume read 3 day event)<BR>FindOutFollowUpDays (By checking the duration field)<BR>If currentDate = first DateOfEvent then<BR>index = 0<BR>do while index &#060; numberofevents<BR> shade current cell<BR> display current date<BR> index + 1<BR>loop<BR>Display date without shading<BR><BR>As you can see we would have shaded three cells in the previous example. But<BR>now i am worried what if the second record&#039;s event starts on the date that<BR>is the second cell that we shaded for the previous record?<BR><BR>Obviously i havent started on it, As i am trying to understand how to do it,<BR>i welcome any ideas, suggestions, tips or any resource that would be<BR>usefull.<BR><BR>Thanks<BR><BR>