Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2009
    Posts
    6

    Red face Unanswered: subtract two columns from each other (was "please help me !!!")

    i just need a simple thing

    iam not using access for long time & all i need to is to subtract two columns from each other which is in 1 table

    & another two but every one is in separate table

    plz tell me wut to do

    thnx alot

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Use the in-built query builder to build a Select Query. When it first pops up you can pick multiple tables. Then use the expression builder to do the necessary subtraction.
    Me.Geek = True

  3. #3
    Join Date
    Mar 2009
    Posts
    6
    i cant use the expression builder !!!

  4. #4
    Join Date
    Mar 2009
    Posts
    6
    plz i need steps

  5. #5
    Join Date
    May 2005
    Posts
    1,191
    Here's instructions on how to start the query builder. If you need more, first try Google searching around for the information you need; there's a lot of information out on the internet about Access (heck, it's how I just found the site I just linked to). Otherwise there are many good books out there that can help you out as well. Remember:
    Quote Originally Posted by Teddy's FAQ
    What is DBForums?

    DBForums is a free forum supported by and for our members. Our active members are here because they enjoy helping folks out (and occassionally need a lifeline ).

    What ISN'T DBForums?

    DBForums may be helpful in a variety of situations, but it is not the one-stop shop for every situation. Here are a few things the MS Access fourm is not

    * Paid Tech Support:
    We are not a paid tech support forum. Please keep this in mind when evaluationg responses to your questions. It is unrealistic to hold an expectation of service above and beyond that of a forum comprised of volunteer members who share their knowledge, experience and solutions just because they like to help. If you expect or demand solutions from our members, you will be unlikely to receive any useful information. If your expectations are flagarantly obnoxious/unrealistic, expect your post to be moderated.
    Me.Geek = True

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Suppose you have a table:Table1 that has 2 columns: Col1 and Col2 and a table:Table2 than also has 2 columns: Col1 and Col2. Both tables also have a primary key: SysCounter that will serve as a "link" between both tables.

    We can write a query like this:

    Code:
    SELECT [table1].[col1]-[table1].[col2] AS [T1C1-T1C2], 
    [table1].[col1]-[table2].[col1] AS [T1C1-T2C1]
    FROM Table1 INNER JOIN Table2 
    ON Table1.SysCounter = Table2.SysCounter;
    See the attached file if you want to know how it looks like in Access.

    Have a nice day!
    Attached Files Attached Files

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by wewe
    i cant use the expression builder !!!
    Is that can't, as in your installation won't allow you to use the query builder

    OR

    Is that can't, as in I can't be bothered to make the effrot to learn to use the query builder

    if the former then try re-installing your copy of Access
    if the latter then, personally I (and I guess most of the the contributors here) can't be bothered to help
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Mar 2009
    Posts
    6

    Post

    Quote Originally Posted by healdem
    Is that can't, as in your installation won't allow you to use the query builder

    OR

    Is that can't, as in I can't be bothered to make the effort to learn to use the query builder

    if the former then try re-installing your copy of Access
    if the latter then, personally I (and I guess most of the the contributors here) can't be bothered to help
    no

    i mean i really tried alot many times & searched for many items but really can't get wut i need , but i liked this forum so i joined to ask heroes like u

    really coz i've been searching for that issue more than a week although i were a 80 % working with access (97) and till 2001

    but after that my carrier took a different way ( networking) so i forgot every thing & that what makes me feel dump .

    even iam reading access 07 for dummies

    anyway thanks 4 help guys

  9. #9
    Join Date
    Mar 2009
    Posts
    6

    Smile

    Quote Originally Posted by Sinndho
    Suppose you have a table:Table1 that has 2 columns: Col1 and Col2 and a table:Table2 than also has 2 columns: Col1 and Col2. Both tables also have a primary key: SysCounter that will serve as a "link" between both tables.

    We can write a query like this:

    Code:
    SELECT [table1].[col1]-[table1].[col2] AS [T1C1-T1C2], 
    [table1].[col1]-[table2].[col1] AS [T1C1-T2C1]
    FROM Table1 INNER JOIN Table2 
    ON Table1.SysCounter = Table2.SysCounter;
    See the attached file if you want to know how it looks like in Access.

    Have a nice day!

    thanks for your effort

  10. #10
    Join Date
    Mar 2009
    Posts
    6

    Exclamation

    Quote Originally Posted by Sinndho
    Suppose you have a table:Table1 that has 2 columns: Col1 and Col2 and a table:Table2 than also has 2 columns: Col1 and Col2. Both tables also have a primary key: SysCounter that will serve as a "link" between both tables.

    We can write a query like this:

    Code:
    SELECT [table1].[col1]-[table1].[col2] AS [T1C1-T1C2], 
    [table1].[col1]-[table2].[col1] AS [T1C1-T2C1]
    FROM Table1 INNER JOIN Table2 
    ON Table1.SysCounter = Table2.SysCounter;
    See the attached file if you want to know how it looks like in Access.

    Have a nice day!
    thanks again

    but i'd like to ask a question

    what is the target of joining two tables by a relation ship . is it just bcoz we r gonna subtract them !!!

    anyway you helped me alot

  11. #11
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You need a way to specify on which line the data you want to process the calculations are located, and the join between both tables just does that.

    Otherwise how could the system know that it has to process the data of line 1 in the first table with the data of line 1 in the second table and not, say process the data of line 1 in the first table with the data of line 3 in the second?

    Am I clear?

    You're welcome again

    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •