"Date" is most likely a reserved word in your database.  Try changing the
column name to something more descriptive like "Start_Date".

HTH
Brian
----- Original Message -----
From: "megan sherman" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, May 09, 2001 9:01 AM
Subject: syntax error when inserting date


> Hi all,
> My action template is supposed to insert classID, location and date into
> a table in my database. When creating new records in the form I provide,
> I want the user to be able to supply a comma delimited list of dates. I
> think the loop in the action template successfully extracts individual
> dates from the date list, but there is a syntax error in the insert
> command. Everything works if I don't try to insert the date, so that
> must be where the syntax error occurs. Can anybody tell me what my date
> syntax error is?
> Thanks in advance!
> Megan
> <<<The action template code is shown below>>>
> <CFIF IsDefined("FORM.scheduleID")>
>  <CFUPDATE DATASOURCE="calkayak" TABLENAME="class_schedule">
> <CFELSE>
> <cfoutput>
> <cfset dategroup=form.date>
> <cfloop index="x" from=1 to=#ListLen(dategroup)#>
> <cfset onedate=ListGetAt(dategroup,#x#)>
> <cfquery datasource="calkayak">
> insert into class_schedule (classID, location, date)
> values(#form.classID#, '#form.location#', '#onedate#')
> </cfquery>
> </cfloop>
> </cfoutput>
> </CFIF>
>
>
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to