Solved

MS Access Math in Query

Posted on 2003-11-12
3
244 Views
Last Modified: 2006-11-17
I want to subtract, add, multiply, and divide different records in my Access query....How do I do this?  For example:

Select Dog, Cat, Beaver
From Animals

I want to divide Dog into Cat, and subtract Beaver from Dog.


I would like to apologize for my example and appreciate your help with this nonetheless.

cheers.

pr
0
Comment
Question by:pryan75
3 Comments
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 250 total points
ID: 9733717
Select Cat/Dog, Dog-Beaver from YourTable

or in the QueryBuilder:

in Column1 in the field row:  Expr1: Cat/Dog

in Column2, in the Field Row Expr2: Dog-Beaver

that will generate this SQL:

Select Cat/Dog as Expr1, Dog-Beaver as Expr2 from YourTable

the two are EXACTLY equivalent.

This of course assumes that Dog, Cat and Beaver are fields the hold NUMBERS in YourTable.

AW
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10025410
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: Arthur_Wood {http:#9733717}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

stevbe
EE Cleanup Volunteer
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now