Results 1 to 3 of 3

Thread: [RESOLVED] Is it possible to use 2 clause in one Update sql query using MySQL on VB6?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2013
    Posts
    35

    Resolved [RESOLVED] Is it possible to use 2 clause in one Update sql query using MySQL on VB6?

    hello there..
    based from the title, is it even posible?
    here is some code :
    Code:
    SQL = "UPDATE table_a SET field_a='Completed'" _
                    & " WHERE field_b='Succesfull'"
                KonekDb.Execute SQL, , adCmdText
    so is that posible to add another clause after
    Code:
    field_b='Succesfull'
    ?

    thnx for beforehand

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,348

    Re: Is it possible to use 2 clause in one Update sql query using MySQL on VB6?

    If you mean add another WHERE clause then no, it's not possible. You don't need to though because, just like in VB, a Boolean expression in SQL can contain as many conditions as you like, separated by AND and OR operators as appropriate, e.g.
    Code:
    WHERE (Column1 = @ValueA OR Column1 = @ValueB) AND Column2 = @ValueC

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2013
    Posts
    35

    Re: Is it possible to use 2 clause in one Update sql query using MySQL on VB6?

    Quote Originally Posted by jmcilhinney View Post
    If you mean add another WHERE clause then no, it's not possible. You don't need to though because, just like in VB, a Boolean expression in SQL can contain as many conditions as you like, separated by AND and OR operators as appropriate, e.g.
    Code:
    WHERE (Column1 = @ValueA OR Column1 = @ValueB) AND Column2 = @ValueC
    i see...
    thnx for your explanation, really apreciated.

Posting Permissions

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



Click Here to Expand Forum to Full Width