Jun 16, 2003 #1 Neozero MIS Jul 7, 2000 49 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 Dec 13, 2002 3,059 GB Code: UPDATE mytable SET myfield = 0 - myfield WHERE myfield > 0 --James Upvote 0 Downvote
Jun 17, 2003 #3 ThatRickGuy Programmer Oct 12, 2001 3,841 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 Oct 16, 2002 545 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 Oct 12, 2001 3,841 US SET myfield = -myfield which opperation does this perform though? -1*x or 0-x? -Rick Upvote 0 Downvote