how to add or subtract a value from a sql database?

  • hi guys

    Let's say I have the number 500 stored in a sql database under the table "users" and under the row "bank account".

    I would like to create a button that when clicked would subtract 50 from it, store it back into the database and display 450 on the screen. What would be the code for that? Thanks

    ps i am using visual studio express 2008 and using vb

  • Do you want help with the DB portion, the VB portion or everything? Can you show us what you have so far? (table structures at the least)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • And please make an attempt to do the work. This almost sounds like a homework or exam question.

    Hint: Use UPDATE for the SQL side.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply