First problem is your SQL shows you are setting both the start and finished
times with the same form field.
Second which still pertains to your SQL, if bookingID is an integer field
then your where clause should be without the single quotes.

Third, you need to calculate the finish time from the starttime plus the
time submitted by the user.

Example:
<Cfset newFinishTime =
DateAdd('n',form.starttime,whatever_the_selected_field)>

Then you can use: #CreateODBCDateTime(newFinishTime)#  for your update
statement



-----Original Message-----
From: Toby King [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 05, 2007 6:08 AM
To: CF-Talk
Subject: adding time

Hi there

In an application I have a page where a user can select how long an event
goes - i.e. 30 minutes, 45 minutes, 60 minutes etc.

In the MySQL database that I have two fields a starttime and a finishtime.

Currently I have the following sql to update the database

UPDATE tbl_bookings
SET starttime = #CreateODBCDateTime(form.startdate)#,
    finishtime = #CreateODBCDateTime(form.startdate)#,
    bookingstatus = '2'
Where bookingid = '#form.bookingid#'

This is at least giving me data in the finishtime column.  What I am trying
to do is use the value selected by the user i.e. 30, 45, 60 etc and add it
to the starttime to get the finishtime but I have not succeeded.

Just wondering if anyone could offer suggestions.

Many thanks.





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292643
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to