Jun 16, 2003 #1 Neozero MIS Joined Jul 7, 2000 Messages 49 Location US What is the best way to update a field to change it to a negative number from a positive? Would I use insert or update? EXAMPLE: I want to change 85996 to show as -85996.
What is the best way to update a field to change it to a negative number from a positive? Would I use insert or update? EXAMPLE: I want to change 85996 to show as -85996.
Jun 16, 2003 #2 JamesLean Programmer Joined Dec 13, 2002 Messages 3,059 Location GB Code: UPDATE mytable SET myfield = 0 - myfield WHERE myfield > 0 --James Upvote 0 Downvote
Jun 17, 2003 #3 ThatRickGuy Programmer Joined Oct 12, 2001 Messages 3,841 Location US or UPDATE mytable SET myfield = -1 * myfield if you just want the opposite wether it's positive or negative -Rick Upvote 0 Downvote
or UPDATE mytable SET myfield = -1 * myfield if you just want the opposite wether it's positive or negative -Rick
Jun 17, 2003 #4 dnoeth Instructor Joined Oct 16, 2002 Messages 545 Location DE Why don't you use a simple SET myfield = -myfield there's no need for "-1 * myfield" or "0 - myfield" ;-) Dieter Upvote 0 Downvote
Why don't you use a simple SET myfield = -myfield there's no need for "-1 * myfield" or "0 - myfield" ;-) Dieter
Jun 18, 2003 #5 ThatRickGuy Programmer Joined Oct 12, 2001 Messages 3,841 Location US SET myfield = -myfield which opperation does this perform though? -1*x or 0-x? -Rick Upvote 0 Downvote