Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    57

    Unanswered: Tell me whats wrong with this UPDATE query

    Code:
    UPDATE CART SET TOTAL_COUNT = TOTAL_COUNT + 1, SET TOTAL_COUNT1 = TOTAL_COUNT1 + 1, SET DATE1 = 10/30/2006 6:17:02 PM, SET PERSON = luke WHERE CART_ID = 1
    I have wacked my head over this query I dont see anything wrong with it

    any ideas?

  2. #2
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Code:
    UPDATE CART 
    SET TOTAL_COUNT =TOTAL_COUNT + 1,
     TOTAL_COUNT1 =TOTAL_COUNT1 + 1,
     DATE1 = '10/30/2006 6:17:02 PM', 
     PERSON = 'luke' 
    WHERE CART_ID = 1
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    one thing that's wrong is there's no line breaks in it. Looks like Joydeep fixed that though.

  4. #4
    Join Date
    Sep 2006
    Posts
    57
    whoa thank you very much

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    what was wrong was that there was more than one SET keyword -- there can be only one

    line breaks are immaterial
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •