Solved

MS Access Math in Query

Posted on 2003-11-12
3
250 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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…

856 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