Multiplication Expression for Access 2003 Update Query

L

lbohen

I have a [Field1] which has several thousand records with numbers in each
record's field. I want to multiply each number by .9333333 and update the
number in [Field1].

How do I do this?
 
J

John W. Vinson

I have a [Field1] which has several thousand records with numbers in each
record's field. I want to multiply each number by .9333333 and update the
number in [Field1].

How do I do this?

Make a backup of your database just in case.

ASSUMING that this is a Number... Single, Number... Double, Number... Decimal
or Currency datatype field, which can all handle decimal places (Currency can
only handle 4):

Create a Query based on your table.

Change it to an Update query using the query type icon on the toolbar or the
Query menu option.

A new row will appear in the query grid labeled "Update To".

Under Field1 on this row type

[Field1] * .9333333

Run the query by clicking the ! icon.

Check the results by looking in the table or in a form bound to the table...
should be done.

If it's the default Number... Long Integer field, the result will also be
rounded to the nearest whole number, which might not be what you want!
 
L

lbohen

John; Thank you! Your instructions worked beautifully.

The field I am updating has numbers like 10.40 however it is a text field.
After I run the update query the result is a number like 10.406666295. I only
need two decimal places.

How do I reduce the result to only two decimal places?
 
J

John W. Vinson

John; Thank you! Your instructions worked beautifully.

The field I am updating has numbers like 10.40 however it is a text field.

WHY are you doing arithmatic calculations on a Text field!?
After I run the update query the result is a number like 10.406666295. I only
need two decimal places.

How do I reduce the result to only two decimal places?

Change the Update To to

Format(Val([Field1]) * .9333333, "#.00")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top