Thanks Charlie. I tried the trim function and it did not help.


The maint_report_date column is a char field. Should it be a date/time datatype in order for this to work properly?


The code you sent still gives the syntax error.


Robert O.

-----Original Message-----
From: Charlie Griefer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 05, 2004 11:19 AM
To: CF-Talk
Subject: Re: Syntax error on Where statement?

instead of asking 'is that it?' (in relation to trimming the report_date
value), why not simply try it?

other than that i'd suggest that if your maint_report_date column is a
date/time datatype, you use a createODBCDate() function around the value
(and drop the single quotes).  I'd futher suggest using a <cfqueryparam> for
both of those dynamic values (maint_report_date and id).

WHERE
     maint_report_date = <cfqueryparam
value="#createODBCDate(form.maint_report_date)#" cfsqltype="cf_sql_date">
AND
     id = <cfqueryparam value="#id#" cfsqltype="cf_sql_integer">

----- Original Message -----
From: "Robert Orlini" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, May 05, 2004 7:56 AM
Subject: Syntax error on Where statement?

> Anyone know why my syntax is wrong in my Where statement please?
>
> Cold Fusion Server logged the following error information:
> ODBC Error Code = 37000 (Syntax error or access violation)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Line 3: Incorrect syntax
near '='.
> SQL = "Update maintenance_report SET maint_report_impact_search = 'NO'
> Where maint_report_date = '06/10/2004 ' and id = 9"
> This is my code:
> <cfquery name="search" datasource="wweb_status_internal_test">
> Update maintenance_report
> SET maint_report_impact_search = '#form.maint_report_impact_search#'
> Where maint_report_date = '#form.maint_report_date#' and id = #id#
> </cfquery>
> I think I may have to trim the maint_report_date field. Is that it?
> Thanks as always.
>
> Robert O.
> HWW
>
>
>
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to