I have added a new field to my Access table called AssignedDate, data type date/time. I then added it to the existing update query and I get this error:
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver]
Too few parameters. Expected 1.UpdatedDate = #Now()#, AssignedDate = #Now()# 503 : WHERE RequestID = '#arguments.RequestID#'
504 :</cfquery>
505 :</cffunction>
SQL:UPDATE Requests_Main SET CADOperatorID = '', EngineerID = 'EAGLE', RequestStatusID = '1', AssingedDate = {ts '2014-11-26 12:50:02'}, UpdatedDate = {ts '2014-11-26 12:50:02'}, AssignedDate = {ts '2014-11-26 12:50:02'} WHERE RequestID = '13999'
DATASOURCE XXX
VENDORERRORCODE -3010
SQLSTATE 07002
Everything is spelt correctly and the data types match, but it will not update.
If somebody can help explain why, I would be very appreciative.
This is the query without any change other than adding the new field. I have tried adding single quotes around the variables, where they are missing, but that didn't work either.
`<cffunction name="UpdateRequest_Assignments" access="public" output="false">
<cfargument name="RequestID" type="numeric" required="true">
<cfargument name="CADOperatorID" type="string" required="true">
<cfargument name="EngineerID" type="string" required="true">
<cfargument name="RequestStatusID" type="numeric" required="true">
<cfquery datasource="#request.DSN#">
UPDATE Requests_Main
SET CADOperatorID = '#arguments.CADOperatorID#',
EngineerID = '#arguments.EngineerID#',
RequestStatusID = #arguments.RequestStatusID#,
AssingedDate = #Now()#,
UpdatedDate = #Now()#,
AssignedDate = #Now()#
WHERE RequestID = #arguments.RequestID#
</cfquery>
cfqueryparamon all variable query parameters. - Leigh