Results 1 to 7 of 7
  1. #1
    Nanabush is offline Novice
    Windows 10 Office 365
    Join Date
    May 2020
    Posts
    11

    Sum of two fields in report depending on a third one.

    I need help!
    I have created an Invoice report and in the bottom left I want to sum all the rows that have VAT-rate 12% on one row and all that have 25% on another row.
    I don't know how to do this cause I'm a novice. Can anyone help me?
    I attached Report and db relations
    .


    Click image for larger version. 

Name:	report VAT.PNG 
Views:	10 
Size:	55.5 KB 
ID:	41818Click image for larger version. 

Name:	report design mode.PNG 
Views:	10 
Size:	50.1 KB 
ID:	41819Click image for larger version. 

Name:	tabellrelationer.PNG 
Views:	11 
Size:	21.7 KB 
ID:	41820

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    the usual way would be to have a conditional iif and the calculation has to be based on the original calculation- something like this in the controlsource

    =sum(iif([vatpercent]=12,[quantity]*[AgreedUponPrice]*[vatpercent]/100,0))


    you'll need to check the 12 - it might be 0.12 and formatted to look like 12,00%, can't tell from the info provided. ditto the calculation
    Last edited by CJ_London; 05-12-2020 at 08:13 AM.

  4. #4
    Nanabush is offline Novice
    Windows 10 Office 365
    Join Date
    May 2020
    Posts
    11
    it is 0.12 and formatted as percent so you're right about that
    I'll give it a try

  5. #5
    Nanabush is offline Novice
    Windows 10 Office 365
    Join Date
    May 2020
    Posts
    11
    Got an error message "Unvalid syntax"

  6. #6
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    need to see the actual code you are actually using

  7. #7
    Nanabush is offline Novice
    Windows 10 Office 365
    Join Date
    May 2020
    Posts
    11
    I tweaked it a little an now it works like a charm. Thank you very much for your help

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

Similar Threads

  1. Replies: 10
    Last Post: 10-07-2015, 05:31 PM
  2. Replies: 6
    Last Post: 02-11-2015, 12:53 PM
  3. Replies: 7
    Last Post: 03-03-2014, 03:33 AM
  4. Copying rows depending on number of fields full
    By tmpgovrel in forum Queries
    Replies: 4
    Last Post: 09-03-2013, 12:11 PM
  5. Open Report or Form depending on condition
    By jheintz57 in forum Forms
    Replies: 5
    Last Post: 03-12-2010, 08:16 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