You may wish to use cfqueryparam for your date/time fields. On 4/18/07, Steve LaBadie <[EMAIL PROTECTED]> wrote: > > I have added a date field to an admin panel and am having trouble getting > it to work properly. In the error message it does show that the text and > date are passing, but am recieving an error with the CFIF. Any thoughts > would be appreciated. > > Error says: "Error Executing Database Query" and "Syntax error in INSERT > INTO" > > <cfset CurrentPage=GetFileFromPath(GetTemplatePath())> > <cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ > "frmAddEvents"> > <cfquery datasource="member_login"> > INSERT INTO Events (Events, Date) > VALUES ( > <cfif IsDefined("FORM.Events") AND #FORM.Date# NEQ ""> > '#FORM.Events#', "#FORM.Date#" > <cfelse> > NULL > </cfif> > ) > </cfquery> > <form action="<cfoutput>#CurrentPage#</cfoutput>" method="post" > name="frmEvents" id="frmAddEvents"> > <input type="text" name="date" id="date" size="15" maxlength="10" > class="formveld" /> > <textarea name="events" cols="70" rows="10" id="events" > class="formveld"></textarea> > <input name="Reset" type="reset" id="Reset" value=" Reset " > class="formveld"> > <input name="Submit" type="submit" id="Submit" value=" Submit " > class="formveld"> > <input type="hidden" name="MM_InsertRecord" value="frmAddEvents"> > </form> > > Steve > >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275792 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4