|
-
Jul 26th, 2007, 12:03 AM
#1
Thread Starter
New Member
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
-
Jul 26th, 2007, 10:14 PM
#2
Addicted Member
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. 
-
Jul 27th, 2007, 10:55 AM
#3
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.
-
Jul 31st, 2007, 01:28 AM
#4
Thread Starter
New Member
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.
-
Aug 1st, 2007, 10:26 AM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|