Results 1 to 5 of 5
  1. #1
    rjbautista20 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    23

    Getting the Total after a result

    Hi Again to All,

    I would to have a query that's compute its total value until the it became negative.hope you can help me again.


    How can i do this in query?



    Thanks

    E.G.
    US1 30,222,277.00 98,795,667.00 (70,263,209.00) US1 30,222,277.00 346,798.00 28,532,458.00 US1 30,222,277.00 21,367.00 28,879,256.00 US1 30,222,277.00 1,321,654.00 28,900,623.00

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Don't understand. Sum until the sum is negative or until a negative value is encountered?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    rjbautista20 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    23
    @june7 thanks again for the reply.

    Ex:

    1,000 - 300 result is 700
    query should base on the result which 700, next row should look like this.
    700 - 200 result is 500 then
    500 - 600 result is -100 and query should stop now.

    Thanks.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    You need to calculate consecutive records. This can be done in a report with the RunningSum property of textbox. Or in a query with this method http://allenbrowne.com/subquery-01.html#AnotherRecord

    I don't think a query can be 'stopped' based on some condition. You would have to fiilter the records.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    rjbautista20 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    23
    hi @june7,

    since the output of my query will be on excel, I created a temp sheet and do the running balance. and glad it's working already.

    Thanks for your help.

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

Similar Threads

  1. VB ADO Query Result Set
    By Bedsingar in forum Access
    Replies: 5
    Last Post: 09-05-2011, 10:45 AM
  2. Delay in the result
    By markyboy in forum Forms
    Replies: 1
    Last Post: 05-25-2011, 09:19 AM
  3. result -1 in Iff statement
    By newtoAccess in forum Queries
    Replies: 10
    Last Post: 04-08-2011, 05:43 PM
  4. can i put the result in array?
    By dada in forum Programming
    Replies: 1
    Last Post: 08-19-2010, 07:17 PM
  5. how to return the result?
    By lamkee in forum Access
    Replies: 1
    Last Post: 08-10-2010, 10:50 AM

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