Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error with 2 condition where (2000)

    why error in this sql:
    SQL1 = "UPDATE SPORTELLI_1 SET SETTORE = '" & MERCATO_3 & "', REGIONE = '" & Left(Me.COMBO_AREA, 4) & "' , MERCATO_CO = '" & Trim(Me.MERCATO_AREA) & "'WHERE SETTORE = '" & MERCATO_3 & "'" AND REGIONE = '" & MERCATO_3 & "'"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: error with 2 condition where (2000)

    There's one " too much in
    <code>
    ... MERCATO_3 & "'<font color=red>"</font color=red> AND ...
    </code>
    Since you have SETTORE = MERCATO_3 in the condition, there is no need to set SETTORE to MERCATO_3 - it already has that value. so you could use
    <code>
    SQL1 = "UPDATE SPORTELLI_1 SET REGIONE = '" & Left(Me.COMBO_AREA, 4) & _
    "' , MERCATO_CO = '" & Trim(Me.MERCATO_AREA) & _
    "' WHERE SETTORE = '" & MERCATO_3 & _
    "' AND REGIONE = '" & MERCATO_3 & "'"
    </code>
    Are you sure that both SETTORE and REGIONE should be equal to MERCATO_3?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: error with 2 condition where (2000)

    OK WORK!
    Note:
    about: Are you sure that both SETTORE and REGIONE should be equal to MERCATO_3?

    but how many eyes have?:-)
    Yes, in the sql have used a not good var really...
    correct also that. tks.

Posting Permissions

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