Results 1 to 5 of 5
  1. #1
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141

    Accumulate in the report

    I have created a report by running a query. in the report the following information are there:


    1-Invoice Date
    2-Total Sale
    3-Total Cost
    4-Internal/External (choice)
    5-Staff Name

    I was able to get the right information on screen.

    below is a sample data
    Invoice Date Total Sale Total cost Int/Ext Staff
    7/1/2017 4000 2000 Int A
    7/1/2017 3000 1500 Int A
    7/2/2017 1500 100 Ext A
    7/2/2017 6000 500 Ext B

    The Total Sale is a text box with the formula =sum(([quantity]*[saleprice])-[discount]))

    I want to accumulate based on the staff and int/ext, so i made another TextBox1 with my formula as:

    =iif([staff]="A" and [int/ext]="Int",sum(([quantity]*[saleprice])-[discount])),"")

    When I made this formula, error was shown on TextBox1, what I do not understande is error was also shown on Total Sale, even thought they have different formulas.

    Can you please help me on this.

    Thank you.

    Trident

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Can't you just run a sum query to get the totals?

  3. #3
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141
    I tried putting this in a sum query but problem is my grouping.

    but i will try your suggestion, it may take a lot of queries, but it will reach the goal.

    Will inform if it works.

    thanks.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Suggest you post a copy of the database. Your sample data has your aggregation for TotalSale etc.
    You are showing us expressions with quantity, saleprice and discount... but no values.
    I would also assume you have InvoiceNumber somewhere in your query/report.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Try:

    =Sum(IIf([staff]="A" And [int/ext]="Int", [quantity]*[saleprice]-[discount], 0))
    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.

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

Similar Threads

  1. Replies: 9
    Last Post: 07-03-2017, 11:24 PM
  2. Replies: 2
    Last Post: 05-22-2012, 11:00 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