Results 1 to 8 of 8
  1. #1
    fredy is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    4

    Exclamation Running Count or Row Count

    Hi All
    My Doubt is simple I wan a Running Total as below Field "Count"

    I need a SQL Query

    RM ID A/c No Count
    Fred 111111 1
    Anil 123232 1
    Fred 546546 2
    Fred 321323 3
    Rocky 121212 1
    Anil 454545 2

    Basically I want the RM ID wise Count for every New Account number and Repeated RM ID Either wise

  2. #2
    fredy is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    4
    RM ID Count
    Fred 1
    Anil 1
    Fred 2
    Fred 3
    Rocky 1
    Anil 1

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,925
    See if you can use the rank order query idea explained here on my website http://www.mendipdatasystems.co.uk/r...ies/4594424063
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,342
    to do it in sql try


    Code:
    SELECT A.RMID, A.AccountNo, Count(B.RMID) AS CountOrder
    FROM myTable A INNER JOIN myTable B ON A.RMID=B.RMID
    WHERE B.AccountNo<=A.AccountNo
    GROUP BY A.RMID, A.AccountNo
    Last edited by CJ_London; 11-06-2018 at 11:13 AM. Reason: correction to criteria

  5. #5
    fredy is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    4
    A.RMID AND B.RMID

    I didn't get it

  6. #6
    fredy is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2018
    Posts
    4
    RM ID Count
    Fred 1
    Anil 1
    Fred 2
    Fred 3
    Rocky 1
    Anil 1
    I want something like this - Count

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,342
    I want something like this - Count
    that is what the sql will do

    A and B are aliases of myTable. you didn't provide your table name, so you need to substitute.

    RMID is the name you provided

    Count is a reserved word, so I used CountOrder

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,342
    I've updated my SQL suggestion - error in the criteria row

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

Similar Threads

  1. Replies: 4
    Last Post: 10-31-2018, 04:58 PM
  2. Running Count Query Help
    By MJD in forum Queries
    Replies: 4
    Last Post: 07-12-2017, 08:01 AM
  3. Replies: 5
    Last Post: 06-11-2013, 12:11 PM
  4. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  5. Running Count Query
    By monkey2003 in forum Queries
    Replies: 0
    Last Post: 09-21-2009, 12:24 PM

Tags for this Thread

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