Results 1 to 3 of 3
  1. #1
    Buddus is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    5

    Accumulative Total Query Help

    I have a Crosstab Query that produces Example A (attached). I need (Example B) a Query or Expression that (totals/counts/sums) each Total Of Record based on Date plus previous Date(s) based on Name. The Total Of Record does not need to be in Example B’s final query.
    Attached Thumbnails Attached Thumbnails Access Pict.JPG  

  2. #2
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742

    A Couple of Likely Queries

    Looks like for Query 2 you are just trying to get one summary record per Name per Date, with the record containing a count of all records up to and including that date. That would look something like this -
    Code:
    SELECT   DISTINCT T1.xName, T1.xDate, Count(*) As xRecords
    FROM     tblYourTable As T1, tblYourTable As T2 
    WHERE    T1.xName  = T2.xName
      AND    t1.xDate <= T2.xDate;
    Hmmm. Might be more efficient to kill the dups before JOINING to the second copy, like this.
    Code:
    SELECT T1.xName, T1.xDate, Count(*) As xRecords 
    FROM (SELECT   DISTINCT xName, xDate
          FROM   tblYourTable) As T1,
          tblYourTable As T2 
    WHERE    T1.xName  = T2.xName
      AND    t1.xDate <= T2.xDate;
    I'm sure there are several other variations that would meet your need, but try that second variation and see whether it gets you what you need. If it works, please mark the thread solved. If not, please report back with the issue.

  3. #3
    Buddus is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    5
    Thanks, had to tweak for my needs it but it worked

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

Similar Threads

  1. Accumulative sum plus another calculation.
    By sberti in forum Queries
    Replies: 3
    Last Post: 12-04-2012, 03:31 PM
  2. Replies: 3
    Last Post: 10-17-2012, 09:24 AM
  3. Total Query
    By ccordner in forum Queries
    Replies: 3
    Last Post: 02-28-2012, 09:30 PM
  4. Total Query
    By joannakf in forum Queries
    Replies: 1
    Last Post: 12-22-2011, 05:35 PM
  5. Help with Query Total
    By mohara in forum Queries
    Replies: 4
    Last Post: 08-20-2010, 02:35 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