oldnewbee 0 Newbie Poster

Could someone please tell me if there's a way that I could insert the time of day into a calendar that I created using CF. I can post events and I know how long they last, but I have not been able to post the time of the events (as they vary). For example Mon, Tue, Wed, Fri appointments are scheduled beginning at 7:30 a.m. - the appointments can vary in length from 1 hour to ? sometimes the whole day can be scheduled if needed. So the users provide the length of time needed - so I know the date and the length of time; but let's say the 1st appointment starts at 7:30 and ends at 8:30 (because the user said the apt. was 1 hour)...then the rest of the day is available for others to schedule. The next user adds an apt that is 2 hours in length. So that means that 8:30 - 10:30 is now taken. I haven't been able to figure out how to get CF to calculate the difference between the times of 7:30, 8:30, 10:30, etc.

The other issue is that on Thursdays, apts begin at 9 a.m.

I haven't done anything with time values previously so this is all new to me. Just googling around didn't provide any information that I felt was helpful. Any ideas/suggestions?

Thanks

oldnewbee 0 Newbie Poster

First I run a simple query to get the max ID from the table, which
returns a number 10284. To which I would like to add a randomly generated number. So I get a number like '2' and it adds it and I get 10287 - which is INCORRECT! I was expecting 10286. So what am I doing wrong? I've run this dozens of times and I can't find a pattern to it...the random number is generating nicely but the results of the two values are rarely what I expect. Thanks for any help!

<cfquery name="Find_Max" datasource="#application.dbfile#">
   SELECT max(MainID) as maxID
   FROM Main
</cfquery>

Returns a number from the table like 10284.

<cfset total =  val(#Find_Max.MaxID#) + val(#RandRange(1,10)#)>
 
<cfoutput>val(#RandRange(1,10)#)</cfoutput><br />
<CFOUTPUT>#Find_Max.MaxID# + random number = #total#</CFOUTPUT>