Can I do simple arithmetics with fields in Access ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I make something like this:

column1 - column 2
but only for some grouped variables

For example: Substract Debt - Payment for each client in NYC, then in CHI ,
etc


or: (Column1 + Column 2)/2
and again, olny for some grouped variables
 
not sure what u mean but perhaps if u create a select query to gather the
grouped data and then create another query that gets its data from the first
query u can then sum your fields.
 
Can I make something like this:

column1 - column 2
but only for some grouped variables

For example: Substract Debt - Payment for each client in NYC, then in CHI ,
etc


or: (Column1 + Column 2)/2
and again, olny for some grouped variables

Since we have no notion whatsoever of your table structure, or what
you mean by "grouped variables", all I can say is "I expect so, if you
set up the query right".

You can see your database structure. We cannot. Can you give us some
help here?

John W. Vinson[MVP]
 
Dear Homie,

Thanks for your kind response, but what I need is to do some algebra OTHER
THAN SUM with the selected fields.

For example: Let A, B be the selected fields:
1) SUBSTRACTING, For example : A - B ( A MINUS B)
2) DIVIDING, ex: A/B,
3) ANY other algebra.

Thanks in advance, your responses are very much appreciated.
 
Dear John,

Thank you for your response. I´ll be mopre specific:
I have these fields:
1) US Domestic flight markets: say: NYC, CHI, LAS, etc
2) # of Bookings for each market in 2006
3) # of Bookings for each market in 2005

Now, I want to SUBSTRACT 3) - 2) only for NYC (2005 bookings MINUS 2006
bookings)
I know I have to make a select query first to select the fields of interest
only for NYC but then I don´t know how to make OTHER operations other than SUM

Hope this wll make your task easy,

I´M THANKFUL FOR YOUR TIME AND PATIENCE.
 
Dear John,

Thank you for your response. I´ll be mopre specific:
I have these fields:
1) US Domestic flight markets: say: NYC, CHI, LAS, etc
2) # of Bookings for each market in 2006
3) # of Bookings for each market in 2005

Now, I want to SUBSTRACT 3) - 2) only for NYC (2005 bookings MINUS 2006
bookings)
I know I have to make a select query first to select the fields of interest
only for NYC but then I don´t know how to make OTHER operations other than SUM

Hope this wll make your task easy,

I´M THANKFUL FOR YOUR TIME AND PATIENCE.

Your table is incorrectly designed, if you have a field [Bookings in
2005] and another field [Bookings in 2006]. What will you do in 2007?
2008? 2010? Keep adding fields, changing the structure of your table,
revising all your queries, revising all your forms? Or am I
misunderstanding your table structure? Could you please do as I
requested and post the ACTUAL TABLE NAMES and ACTUAL FIELD NAMES in
your table?

Given the structure you have, though, and guessing at fieldnames
(which you have chosen not to post), create a Query based on the
table. Select the Markets field and put

"NYC"

or, more flexibly,

[Enter market code:]

on the Criteria line under that field.

In a vacant Field cell type

Booking Change: [2005 Bookings] - [2006 Bookings]

This kind of expression allows any arithmetic operator, parentheses,
etc. - it's very flexible. I have no idea where you got the notion
that all you can do is add. The SUM operator sums ACROSS RECORDS in
the same field.

John W. Vinson[MVP]
 
Back
Top