Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the correct or best approach in editing a table? 1

Mandy_crw

Programmer
Jul 23, 2020
589
PH
Hi everyone...I have one main table that contains main record that contains name surname and idnum... i have a another table that contains transactions of each of the record in the main table. My question is, what if i needed to correct some of the entries in the transaction table of a particular idnum?

main table
0001 Maria
0002 Mamang
0003 Makina
0004 Mandy

transaction
0001 560.00
0001 340.00
0004 120.00
0001 350.00
0003 450.00

in the transaction table i needed to correct 340.00 to 890.00 and 350 to 670.00... cosidering i have thousand of transaction in the table ... what is the best approach? and if ever ill be using update, please show me how... Thanks in advanced....
 
Hi Mandy,

If you occasionally have to update the transaction table you could use a filtered browse e.g.

Code:
use transaction table
browse for transactionid = "0001"

and do the required updates or

Code:
replace in transaction all amounts with 890 for amount = 340 and transactioncode = "0001"

or even

Code:
update transaction set amount = 890 where amount = 340 and transactioncode = "0001"


hth

MarK
 
Thanks Mark... actually ive used UPDATE... but for some reason it sometimes it works sometimes not... but I'll try REPLACE... Thanks again Mark...
 
Hi Mandy,

Maybe REPLACE won't work either if you cannot determine the reason why UPDATE sometimes works and sometimes not

hth

MarK
 
Last edited:

Part and Inventory Search

Sponsor

Back
Top