another good old syntax error. I've stared at this for half an hour, can't see what's 
wrong. anyone else any ideas?

<cfset fromdate=createdate(year(now()),month(now()),day(now()))>

<!-- this for gardner -->
<cfquery datasource="artsoutheast" name="grabdiary">
SELECT *
FROM story_info
WHERE name = 'gardner'
AND story_type = 'diary'
AND
(( event_start_date >= #fromdate#)
OR
( event_end_date >= #fromdate#))
</cfquery>

<cfoutput query="grabdiary">

<cfset start = CreateODBCDate(DateFormat(event_start_date, 'yyyy-mm-dd'))>

<cfif event_end_date IS NOT ''>
<cfset end = CreateODBCDate(DateFormat(event_end_date, 'yyyy-mm-dd'))>
<cfelse>
<cfset end = ''>
</cfif>


<cfquery datasource="#dsn#">
INSERT INTO diary (directoryid, reviewid, startdate, enddate, artform, ticketprice, 
title, familyfriendly, audiodescribed, signed, surtext, description, publish, 
eventimage, dateadded, edpick) VALUES (1, 0, #variables.start#, #variables.end#, 0, 
'varies', '#story_title#', 'no', 'no', 'no', 'no', '#story_copy#', 'no', 
'#story_image#', #CreateODBCDate(Now())#, 'no')
</cfquery>

</cfoutput>

______________________________________________________
ODBC Error Code = 37000 (Syntax error or access violation) 

[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. 


SQL = "INSERT INTO diary (directoryid, reviewid, startdate, enddate, artform, 
ticketprice, title, familyfriendly, audiodescribed, signed, surtext, description, 
publish, eventimage, dateadded, edpick) VALUES (1, 0, {d '2003-10-04'}, , 0, 'varies', 
'Nicholas Nickleby [PG]', 'no', 'no', 'no', 'no', 'An all star cast including 
Christopher Plummer, Jamie Bell and Jim Broadbent head up this adaptation of one of 
Dicken's best-loved novels. ', 'no', '', {d '2003-09-29'}, 'no')" 

Data Source = "ARTSOUTHEASTDEV" 


The error occurred while processing an element with a general identifier of (CFQUERY), 
occupying document position (36:1) to (36:28) in the template file 
D:\artsoutheast\test\changedb.cfm.

I wish the error messages would be a bit more useful - like telling you where in the 
query it had got to before the syntax error occurred...

any help appreciated.

Ian W

Reply via email to