I have created a booking table for the intranet system. I have created a table containing date and time. The date is displayed in the column and the time is through the row. If anyone books on a certain date and time, the column and row consisting of the time and date will be displayed with the word BOOKED. <br> My major problem here is that for example if i were to book on the 15th at 10.00am the word Booked will appear at the column and row which was chosen, but if i were to book on 16th (the next day) with the same time, the information on 16th will not be shown on the grid unless i delete the 15th information or i have to delete the 16th information to get the 15th information.<br><br> Here is the code which generates the date and time :<br><br>The code below generates the date:<br><br><cfloop from="1" to="7" index="ColCount" ><br> <cfset theday=DateAdd("d",ColCount-1, CreateDate(year,month,day))><br> <cfset thenextday=DateAdd("d",1, theday)><br> <br> <cfquery name="new_cal" datasource ="bookings"><br> select * from booking<br> where start_time BETWEEN #theday# AND #thenextday#<br> </cfquery> <br> <br> <cfoutput><td bgcolor="blue"><br> <div align="left"><font face="Arial, Helvetica, sans-serif" size="2" color="white"> <br> <b>#DateFormat(theday,"dd-mmm-yyyy"
#<br> </div></td></cfoutput><br></cfloop> <br><br>The code below is where i generated the time :<br><br><cfset thistime=700> <br><cfloop index="RowCount" from="7" to="23"><br> <tr align="right" bgcolor="#FFFFCC"><br> <td><br> <cfset thistime=thistime+30><br> <br> <cfoutput><b><br> #timeformat(createtime(rowcount,0,0),"hh:mm tt"
#</cfoutput></td><br> <cfset detect=0><br> <cfloop from="1" to="7" index="ColCount"><br> <cfset theday=DateAdd("d",ColCount-1,CreateDate(year,month,day))> <br> <cfset first_hour=DateAdd("h",RowCount-detect,theday)> <br> <cfset last_hour=DateAdd("n",59,first_hour)> <br> <br> <cfquery name="new_cal" datasource ="bookings"><br> select * from booking<br> where start_time BETWEEN #first_hour#<br> AND #last_hour#<br> </cfquery> <br> <br> <cfif new_cal.RecordCount NEQ 0><br> <cfoutput query="new_cal"> <br> <td bgcolor="CCCCCC"><a href="view.cfm?bid=#b_id#">Booked</a><br> </cfoutput> <br> <cfset detect=detect+1> <br> <cfelse><br> <cfset detect=0> <br> <td><br> </cfif> <br> <cfoutput> </cfoutput> <br> </td><br></cfloop> <br><br>I would be very grateful if you could help me on this as soon as possible as i have to launch it in my intranet already. Thank you.<br><br>