Solved

MS Access Math in Query

Posted on 2003-11-12
3
254 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

734 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