Results 1 to 2 of 2
  1. #1
    lambo102 is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2011
    Posts
    1

    Subtract from Previous Row

    Hopefully this isn't a big deal but I have a query that shows various data as you may expect.



    Date Number1
    1/01/11 12345
    1/15/11 19182

    I'm looking for a way to show the difference from row to row. For example, I want to add a column after Number 1 that shows me how much Number 1 increased (or decreased) from the previous row.

    This is one of those painfully easy things in Excel, but I'm not sure how to tell Access to do it.

    Please help?

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    databases are different then excel sheets - that's for sure. really isn't an Access issue per se - any database has the same issues.

    a query presents data. it isn't the ideal vehicle for multi line actions - until you get into high end self joins - but lets not go there for the moment.

    in a form or report - it is very simple to do math in the footer or group footer. If you have an Access textbook easily found at Amazon or any large book store - - they all go thru this.

    back to a query; in a query one can easily do math within a single row using a calculated field (also in your text book). the key then is how you get the needed data all in the same row. And for that it would require a single unique value in both records (and no other records) that you can join on. you can put the same table up twice in query design view and then join.

    Hope it helps.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to do subtract in Query
    By NoOoN in forum Queries
    Replies: 6
    Last Post: 04-07-2011, 01:15 PM
  2. Subtract from inventory
    By NISMOJim in forum Access
    Replies: 5
    Last Post: 01-30-2011, 01:09 PM
  3. Subtract From Previous Record Using a Date
    By txrules in forum Queries
    Replies: 1
    Last Post: 12-30-2010, 02:10 AM
  4. Replies: 9
    Last Post: 03-19-2010, 10:37 AM
  5. Subtract Rows in Query Results
    By Sengenbe in forum Queries
    Replies: 5
    Last Post: 02-08-2010, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums