check your value for enddate, it's trying to insert a null value just now:

{d '2003-10-04'}, , 0,


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------


                                                                                       
                            
                    "Ian                                                               
                            
                    Westbrook"           To:     "cfug dev list" <[EMAIL PROTECTED]>   
                  
                    <[EMAIL PROTECTED]        cc:                                      
                                 
                    eam.net>             Subject:     [ cf-dev ] syntax error          
                            
                                                                                       
                            
                    29/09/2003                                                         
                            
                    17:18                                                              
                            
                    Please                                                             
                            
                    respond to                                                         
                            
                    dev                                                                
                            
                                                                                       
                            
                                                                                       
                            



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





-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to