Skip to main content
Participant
March 14, 2008
Question

Incorrect Syntax

  • March 14, 2008
  • 7 replies
  • 671 views
Below is the error I recieve - Im close because its passing the data through but it stops here. I have ticks by the email and reason on purpose. Pretty sure thats how it should be done. Thanks in advance for even looking at it.


Error Occurred While Processing Request
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Line 2: Incorrect syntax near ' '.

The error occurred in /var/www/vhosts/comapny/httpdocs/act_unsubscribe.cfm: line 14

12 : (Email, Reason, Date)
13 : Values
14 : ('#attributes.email#', '#attributes.reason#', getdate())
15 : </cfquery>
16 :
============================================
Code
This topic has been closed for replies.

7 replies

Astonished_protector15C3
Participating Frequently
March 19, 2008
Hi,

Please try this #now()# instead of getdate()
Known Participant
March 19, 2008
Hi, If you still can't resolve this put the whole SQL statements in a cfoutput tag and see what the query will be in runtime.Then it will be easy to debug.Also use #dateformat(now())# inside quotes.
HTH
March 15, 2008
Try using #dateformat(now())# instead of your getdate function and see if that works. If it does, the driver is choking on your trying to pass the function rather then an actual date.
Inspiring
March 15, 2008
You debug output shoudl also display the actual SQL statement being sent to
the DB driver. It'll be more clear from that what your problem is. I
suspect Dan is correct, though.

--
Adam
Inspiring
March 14, 2008
It doesn't have to be within cfoutput. I'm guessing that attributes.reason has an apostrophe in it somewhere. cfqueryparam will fix that and give you some other benefits as well.
Inspiring
March 14, 2008
I take that back, getdate() is an sql function (I totally knew that! I swear!)...

Well, it looks fine to me. The only thing I see that could be the problem with it is if attributes.email or attributes.reason had a tick mark in it.

Also, this is all within a <cfoutput> right? Just checking.
Inspiring
March 14, 2008
You need to put getdate() within #'s; I think it has to go within the tick marks as well.