Skip to main content
Participating Frequently
July 18, 2010
Question

Error on Update Query - Issue with date???

  • July 18, 2010
  • 1 reply
  • 618 views

Any help here would be much appreciated, this has me stumped and could use another set of eyes..

Here is my update query:

<cfquery name="Update_Contact" datasource="#XXX#">
     UPDATE TBL_CONTACT
     SET Firstname = '#l_struct_orderuser.struct_contact.firstname#'
     AND Lastname = '#l_struct_orderuser.struct_contact.lastname#'
     AND Email = '#l_struct_orderuser.struct_contact.email#'
     AND Password = '#l_struct_orderuser.struct_contact.password#'
     AND Phone = '#l_struct_orderuser.struct_contact.phone#'
     AND Company = '#l_struct_orderuser.struct_contact.company#'
     AND Address = '#l_struct_orderuser.struct_contact.address#'
     AND City = '#l_struct_orderuser.struct_contact.city#'
     AND fk_province_id = #l_struct_orderuser.struct_contact.fk_province_id#
     AND Postal = '#l_struct_orderuser.struct_contact.postal#'
     AND fk_studio_id = #l_struct_orderuser.struct_contact.fk_studio_id#
     AND UUID = '#l_struct_orderuser.struct_contact.UUID#'
     AND last_login_timestamp = #createodbcdatetime(Now())#
</cfquery>

Here is the error I am receiving:

Error Executing Database Query.

[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'AND'.

49: AND fk_studio_id = #l_struct_orderuser.struct_contact.fk_studio_id#
50: AND UUID = '#l_struct_orderuser.struct_contact.UUID#'
51: AND last_login_timestamp = #createodbcdatetime(Now())#
52: </cfquery>

VENDORERRORCODE  156
SQLSTATE  HY000
SQL   UPDATE TBL_CONTACT SET Firstname = 'Santa' AND Lastname = 'Claus' AND Email = 'test@test.com' AND Password = '12345' AND Phone = '5555555555' AND Company = 'CCI' AND Address = '123 Main St' AND City = 'Cgy' AND fk_province_id = 4 AND Postal = 'T4T4T4' AND fk_studio_id = 19 AND UUID = '09F6280A-0DF5-31A2-76EEC9F88D820B27' AND last_login_timestamp = {ts '2010-07-18 15:07:28'}

Can anyone help?  Thanks so much!

This topic has been closed for replies.

1 reply

Inspiring
July 18, 2010

Your syntax is incorrect.  Separate everything with commas, not the word "and

".

Participating Frequently
July 18, 2010

Ha!

See, I knew I needed I second set of eyes, been sitting at the comp for 7 hours straight.  Time for a break!

Thanks so much Dan!