Simple Math with Numeric Fields in Access 2007

Microsoft Access Add comments

Many calculated fields rely entirely on ordinary high school math. Table 6-1 gives a quick overview of your basic options for combining numbers.

Table 6-3. Arithmetic Operators

Operator

Name

Example

Result

+

Addition

1+1

2

-

Subtraction

1-1

0

*

Multiplication

2*2

4

^

Exponentiation

2^3

8

/

Division

5/2

2.5

\

Integer division (returns the lowest whole number and discards the remainder)

5\2

2

Mod

Modulus (returns the remainder left after division)

5 Mod 2

1

You’re free to use as many fields and operators as you need to create your expression. Consider a Products table with a QuantityInStock field that records the number of units in your warehouse. To determine the value you have on hand for a given product, you can write this expression that uses two fields:

ValueInStock: [UnitsInStock] * [Price]


Warning: When performing a mathematical operation with a field, you’ll run into trouble if the field contains a blank value.


Popularity: 2% [?]

Related Post

  • Defining a Calculated Field in Access 2007
  • Expressions with Text in Access 2007
  • Creating a Simple Query with the Query Wizard in Access 2007
  • Formatting numeric fields in Windows Vista
  • Creating a Simple Form in Windows Vista
  • Don't Find What You're Looking For? Please Try Here...

    Google
     

    Leave a Reply

    WP Theme & Icons by N.Design Studio
    Entries RSS Comments RSS Add to Technorati Favorites Log in