Jeszejared,
Since you are so new to Access, I thought I'd tell you some things you may not know (I apologize if I'm telling you something you
already know).
Rick's method is just a calculated field in a SELECT query. When you run this query, this calculated field shows up in your
results, but it doesn't actually exist. The underlying data remains unchanged.
Klatuu's method is an UPDATE query and it WILL change your underlying data.
Both methods are correct, but it all depends on what you will be doing with your data as to which method you decide to use. If you
use Klatuu's method, any queries based on this table will run faster after you run his UPDATE query. You may not notice it if you
have just a few thousand or hundred thousand records, but the higher the number of records, the more you will notice.
If you will be importing new data into this table from text files or spreadsheets, you might consider using a calculated field in a
SELECT query. If you are importing, this can be done using the update method, but it can be a little tricky. Let me explain: If
you are importing data from an external source (text files, spreadsheets, etc...) and this field is negative in these source files,
when you run the UPDATE query on this table that has old data that has already been switched to positive and also has new data that
is still negative, all of the old data will be flipped to negative numbers and the new data will become positive. To work around
this you either need to change the data in the source files to positive before importing, have a 2-step import (import into an
intermediate table first--and then from the intermediate table, import into the main data table flipping the negatives to positives
in the process), or have an extra field in your table that will signify if the data is old, already changed data or if it is new,
unchanged data and then build your UPDATE query so it will change only the new, unchanged data.
If you are manually entering data, none of that matters. All you have to do is remember to enter it as a positive number instead of
a negative one.
I hope this helps.
Klatuu and Rick, I apologize if I am stepping on your toes.
Conan Kelly
Klatuu,
You ARE the BEST~!!!! THANKS A ZILLION!!!
J.
In the main database window.
Select Queries
Select New
Select Design View
Select the table with the field you want to change
From the menu bar, select Query
Select Update Query
Now, your query builder will show the table and it's fields in the top
portion. In the bottom portion, you will only have to use the first 3 rows,
Field:, Table:, and Update To:
In the top portion, double click on the field you want to update. It will
then appear in the first column in the bottom section Showing the Field name
and the Table name.
Type the following in the Update To: row below the field and table name.
Change MyFieldName to the name of your field:
[MyFieldName] * - 1
when you tab out of the box, it will change to Expr1: [MyFieldName] * - 1
That is okay.
Click on the red exclamation pint in the tool bar to run the query.
That should do it.
Oh, I forgot the part about make a copy of the table first...just in case
:
Hi Klatuu,
Thank u for your info but I am quite a beginner with Access so can u
elaborate a bit more.
I got what Rick was saying but I sure like to know how to do yours.
Thanks.
J.
Klatuu wrote:
Just do an update query with either of those formulas you like as the
UpdateTo for that field.
:
hi,
I want to change a column in my MS Access DB to reflect positive figure
because currrently it is showing all negative figures. can anyone
assist me?
thanks.
p/s: i have seen a solution posted stating that to change the field
from negative to positive:
MyFieldNegative: -[MyField]
or
MyfieldNegative: -1*[MyField]
like to know where i should put in this particular formula/script.
thank you.
J Mil
Toronto, CANADA