Formulas

T

Té

Can Access run formulas and calculations like Excel does? I noticed when I
imported an Excel file that had calculations on it it did not carry over.
 
K

Ken Snell MVP

Not like EXCEL in terms of doing it in the table, but yes in terms of using
a query or a form or a report.
 
S

Steve

Yes! Access can run formulas and calculations by entering the calculation in
a blank field of a query (called a calculated field). Access can run
formulas and calculations by entering the calculation in the control source
of an unbound textbox on a form or report. Access can run formulas and
calculations in VBA code.

Steve
(e-mail address removed)
 
K

KenSheridan via AccessMonster.com

Yes, but don't be confused by the superficial similarity between the
datasheet view of an Access table and an Excel worksheet into thinking that
they behave in the same way. In an worksheet values can be addressed by
position, in an Access table (and indeed a table in any relational database
system) values are addressed by the table and column name.

With a query based on an Access table you could for instance compute a price
gross of tax for an item in each row with an expression (this is the term
normally used rather than the spreadsheet term 'formula') such as:

NetPrice * (1 + TaxRate)

I should point out that this is an unrealistic example as, in an invoice, tax
would normally be computed on the sum of the net prices of the items rather
than by line item, but it serves to illustrate the basic principle. A more
realistic expression would be one which sums the net prices per invoice and
then adds the tax:

Sum(NetPrice) * (1 + TaxRate)

An expression like this could be used in the footer of an invoice report for
instance where the tax rate is the same for all items, or in a TaxRate group
footer if different categories of items can be taxed at different rates.

What you cannot do is something like multiply the value of the field two
columns to the left and three rows down by that four columns to the right and
one row up. While those spatial relationships are valid in a worksheet, they
are meaningless in a table as tables are sets and as such have no intrinsic
order.

Ken Sheridan
Stafford, England
 

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