Results 1 to 5 of 5
  1. #1
    dimkos is offline Novice
    Windows 8 Access 2013
    Join Date
    Dec 2015
    Posts
    2

    Running sum

    Hi,

    I have a time line with fixed intervals [Time_interval] and Events the task is to generate a query that will have a new field [Resourse] in a way that after each event we get in the next 2 consecutive intervals 1 resource.

    Time_interval Event Resourse
    2 yes 1
    3 1
    4
    5
    6 yes 1
    7 yes 2
    8 1
    9
    10 yes 1
    11 1
    12
    13




    thanks in advance

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What you want is not easy in query even when the data is suitable, and your data is not. The Event data does not lend itself to 'grouping' records - there are only 2 values - Yes or No. And what you want depends on data that can 'group' the records - an indicator that the group has changed and the numbering should start over.

    Review: http://allenbrowne.com/ranking.html
    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
    dimkos is offline Novice
    Windows 8 Access 2013
    Join Date
    Dec 2015
    Posts
    2
    Isn't it possible to use somehow DSUM fuction in the [Resourse] field in a way that in the 'criteria' part i fix somehow 2 consecutive intervals ?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Criteria must be based on data.
    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
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    Isn't it possible to use somehow DSUM fuction in the [Resourse] field in a way that in the 'criteria' part i fix somehow 2 consecutive intervals ?
    Hi Dimkos,

    There are many ways to do this, but a deeper understanding of your data structure and record recording standards are necessary in order to assist.

    What is your source table structure? Are records reliably present for every interval? Are there any criteria other than "consider the previous two intervals", such as "consider the previous two intervals only when both intervals have event=yes"?

    Can you provide sample data for your source table and a mock up of what you want the output to be?

    If you invest a bit more, I'm sure we can help more.

    Cheers,

    Jeff

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

Similar Threads

  1. Replies: 6
    Last Post: 09-14-2015, 06:05 PM
  2. Running Sum
    By BringTheR41n in forum Queries
    Replies: 2
    Last Post: 07-10-2014, 12:45 PM
  3. running sum
    By chavez_sea in forum Queries
    Replies: 1
    Last Post: 10-09-2013, 03:13 PM
  4. Running queries, VIA VB, but not running in Order
    By mike02 in forum Programming
    Replies: 6
    Last Post: 06-01-2013, 07:07 AM
  5. Running Sum
    By rpgowned in forum Queries
    Replies: 2
    Last Post: 08-30-2011, 10:17 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