Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error on Update Query - Issue with date???

New Here ,
Jul 18, 2010 Jul 18, 2010

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!

TOPICS
Database access
593
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 18, 2010 Jul 18, 2010

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

".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 18, 2010 Jul 18, 2010
LATEST

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources