Results 1 to 6 of 6
  1. #1
    rwsolutiondesign is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2016
    Posts
    2

    crosstab problems

    Hello everyone!

    Im stuck with a issue that appears to be difficult for me , and probably easy for you. I created a crosstab query that gives me the values i need by date
    which is working very well. The only problem I'm having is that I am unable to do a summary based on the values presented. example



    what I'm wanting is to have each day totaled at the bottom of the report. Here is my code

    TRANSFORM Count(MAINtexarkana.MAINID) AS CountOfMAINID
    SELECT MAINtexarkana.PASSENGER, MAINtexarkana.SERVICEID, MAINtexarkana.STATUSID


    FROM MAINtexarkana
    GROUP BY MAINtexarkana.PASSENGER, MAINtexarkana.SERVICEID, MAINtexarkana.STATUSID
    PIVOT Format([dateoftrip],"Short Date") In (5/1/2017,5/2/2017,5/3/2017,5/4/2017,5/5/2017,5/8/2017,5/9/2017,5/10/2017,5/11/2017,5/12/2017, 5/15/2017,5/16/2017,5/17/2017,5/18/2017,5/19/2017,5/22/2017,5/23/2017,5/24/2017, 5/25/2017, 5/26/2017,5/29/2017,5/30/2017,5/31/2017);

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    The image is not displaying for me.

    This query is the RecordSource for a report object? What have you tried? Did you put textbox in report footer section with calculation to Sum() field?

    Building a stable report to run perpetrually based on CROSSTAB is very difficult, especially when pivoting dates. With the query shown, you will have to rebuild the report every month. Review http://allenbrowne.com/ser-67.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
    rwsolutiondesign is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Sep 2016
    Posts
    2
    Yes I've tried to footer calculation to sum the field by creating a text box, which gives me the totals i am needing but is invisible in datasheet view. What im thinking is that
    maybe i should do a subreport. And yes, you are correct i would have to rebuild my report every month. I can not find another way to filter by day using a crosstab query.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Not sure what you mean by 'datasheet view' for a report. Report has ReportView and PrintPreview.
    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
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    This has an example of a calendar form using a crosstab query.
    Attached Files Attached Files

  6. #6
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    705
    Here is an ecample of how I get totals for rows and columns of a crosstab query.

    Dynamic Report based on a Crosstab query

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

Similar Threads

  1. Replies: 7
    Last Post: 09-03-2015, 11:31 AM
  2. Replies: 4
    Last Post: 08-26-2015, 09:55 PM
  3. Crosstab Report
    By Youngfighter in forum Reports
    Replies: 5
    Last Post: 12-26-2014, 06:08 AM
  4. Crosstab?
    By justin1681 in forum Access
    Replies: 3
    Last Post: 06-27-2012, 12:41 PM
  5. Crosstab example
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-24-2010, 12:07 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