Results 1 to 2 of 2

Thread: UPDATE reset

  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In table MYTABLE have fields PROVA1 and PROVA2

    PROVA1 PROVA2
    0500 AAAAAA
    0501 BBBBBB
    ...
    ECC...


    Have a var1=0500 var2=AAAAAA

    ho to update the rset 0500 AAAAAA

    only if var2<> PROVA2

    wit the tipical sql update ....

    example:
    var2=AAAAAA
    skip
    var2=AAAAAB
    update PROVA2

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts
    [quote name='sal21' post='775678' date='18-May-2009 22:51']In table MYTABLE have fields PROVA1 and PROVA2

    PROVA1 PROVA2
    0500 AAAAAA
    0501 BBBBBB
    ...
    ECC...


    Have a var1=0500 var2=AAAAAA

    ho to update the rset 0500 AAAAAA

    only if var2<> PROVA2

    wit the tipical sql update ....

    example:
    var2=AAAAAA
    skip
    var2=AAAAAB
    update PROVA2[/quote]
    Do you mean to update that table using VBA code, if so, does this do what you want?

    strSQL = "UPDATE MYTABLE SET PROVA2 = 'xxxxx' WHERE PROVA2 <> '" & var2 & "'"

    I dont know what value you want to set PROVA2 to, just change the xxxxx to what you want.

Posting Permissions

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