p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Pro VB Databases (http://p2p.wrox.com/forumdisplay.php?f=81)
-   -   SUM or What (http://p2p.wrox.com/showthread.php?t=6567)

bertlf November 26th, 2003 04:19 AM

SUM or What
Hello, I have a table that has several money columns and want to update multiple records based on my query. The records need to SUM or ADD like so column1 = column1 + column2 then set column2 to 0.
After that a math function runs on all the changed records. Any advice for most efficient way would be welcome. I am using VB6 and ADODB. I can make this happen completely through VB6 but thought that SQL Transaction Processing might be faster and more efficient.
Thanks B[8D]

jlick November 26th, 2003 12:11 PM


    UPDATE TableName
        SET Column1 = Column1 + Column2,
            Column2 = 0
    WHERE -- Limit to the correct rows.

John R Lick

bertlf November 29th, 2003 02:44 PM

Thanks John,
That helped a lot!
I have much to learn and this project has been a fun challenge.

All times are GMT -4. The time now is 02:59 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.