Results 1 to 3 of 3
  1. #1
    ggfs is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    2

    Question Total Column of Switch Values on a Report

    I am trying to total the amounts produced by the following Switch statement on a report:



    =Switch([Days Past Due When Paid]<30,[Amount Paid]*0.02,[Days Past Due When Paid]<60,[Amount Paid]*0.06,[Days Past Due When Paid]<76,[Amount Paid]*0.08,[Days Past Due When Paid]<90,[Amount Paid]*0.12,True,0)

    The column is the amount of commission made off of each call a rep makes. The percentage increases after a certain date range is passed. I would like to total how much commission the rep made.

    Any suggestions?

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Create a new query with the existing query as the record source. Make the query an aggregate query -- Group on the Rep and Sum on the Commission Field.

    Alan

  3. #3
    ggfs is offline Novice
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    2

    Lightbulb Solution Found

    =Sum(Switch([Days Past Due When Paid]<30,[Amount Paid]*0.02,[Days Past Due When Paid]<60,[Amount Paid]*0.06,[Days Past Due When Paid]<76,[Amount Paid]*0.08,[Days Past Due When Paid]<90,[Amount Paid]*0.12,True,0))

    This is was what I put in the Control Source of the Total Box in the Group Footer and it works pefectly! Thank you for your help.

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

Similar Threads

  1. Replies: 2
    Last Post: 03-02-2011, 01:43 PM
  2. Replies: 5
    Last Post: 09-10-2010, 10:07 AM
  3. Total of column with check boxes
    By turbosdad in forum Queries
    Replies: 4
    Last Post: 08-07-2010, 07:03 AM
  4. Replies: 7
    Last Post: 04-27-2010, 02:47 PM
  5. inserting values in column based another column
    By wasim_sono in forum Database Design
    Replies: 1
    Last Post: 06-27-2006, 05:23 AM

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