Results 1 to 5 of 5

Thread: multiply all values in one column and update

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    2

    multiply all values in one column and update

    hello,

    does any1 here noes how to multiply all the values by a number and update it back to the database.

    I'm using microsoft access and VB 2005

    eg. multiply by 2
    Value
    --------
    2
    10
    8


    result
    -------
    4
    20
    16

  2. #2
    Addicted Member JuzMe's Avatar
    Join Date
    Jul 2006
    Posts
    209

    Re: multiply all values in one column and update

    You are also doing 3 tier right? My codes may not be working very well but I think you need make some changes. You can go here to see my codes http://vbforums.com/showthread.php?t=481044
    I am such a VB.NET 2005 idiot. Sorry If I don't even know basic stuff.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: multiply all values in one column and update

    Loop through all the numbers in that column (you haven't told us what the control is that you're using). Once you do, modify the corresponding values in the dataset.

    Or, provide an edit template with a button that executes a bit of javascript next to it, when the user clicks save, simply save to database.

    So, look up both methods or whichever one is closest to what you were thinking but didn't write.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    2

    Re: multiply all values in one column and update

    but i don't need it to show it out. I just need to update in the database.
    I need to click a button to activate this function only.

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: multiply all values in one column and update

    Now that'd be possible using some SQL, but I must mention that you shouldn't be storing calculated values in a database. It's redundant because the data is already there. You should always calculate the values you need when they are to be retrieved.

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