Keyword date, didnt even dawn on me, but that is the more likely answer. On 4/18/07, Charlie Griefer <[EMAIL PROTECTED]> wrote: > > 1) Date is a reserved word. If you can't change it, enclose it in > square brackets. > 2) you have 2 columns specified (Events, Date) but in your <cfelse> > condition you're only inserting a single value. You should have NULL, > NULL. > > 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 > > > > > >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275793 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4