Results 1 to 3 of 3
  1. #1
    jerseyaccess is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Aug 2016
    Posts
    1

    Dsum issue when more than one column is used


    I am using Access 2013 and have a report which is working fine.

    It sums the number of times each sales person's name appears in a column and adapts when I use a filter i.e. if I limit records to the current month only, the total adapts accordingly. There is a different total field for each salesperson.

    I have two relevant columns. The first is 'LeadNegotiator' and the second is 'NegotiatorTwo. Both sum as described in the previous paragraph.

    Here's the problem... There are times when the salesperson shares a sale with another salesperson. So instead of the whole sale being counted as one (to one person) it is counted as half a sale each.

    Formulas are as follows...

    =Sum(IIf([LeadNegotiator]=7,1,0)) with the '7' changing depending on the salesperson

    =Sum(IIf([NegotiatorTwo]=7,1,0)) with the '7' changing depending on the salesperson

    How do I adapt my code to reflect this?

    Any help greatly appreciated

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    it feels like your data is not normalised so makes this type of calculation difficult. Also, what happens if you have a third negotiator?

    You should have a table which lists one negotiator and their role in one record - something like

    tblNegotiators
    NegotiatorPK autonumber
    SaleFK long - links to sales detail table
    EmployeePK - long - links to employee table
    Role - could be text, could be a link to another table, could be just a number to indicate level (1=Lead negotiator, 2=negotiator2, 3 =negotiator3 etc) or may not be required at all if shares are always evenly split

    then your query becomes very straight forward

    otherwise I would guess that something like this might do the trick

    =Sum(IIf([LeadNegotiator]=7 or [NegotiatorTwo]=7,1,0))

  3. #3
    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,870
    I agree with Ajax that you probably have a table design/normalization issue.
    I recommend you show us a copy of your tables and relationships (jpg), and a clear description of the business as it concerns Sales and the people involved.

    With well designed table(s) it sounds like an query with a Count and Group By might be appropriate. But your shared Sale might not fit.

    Good luck.

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

Similar Threads

  1. Access Issue - selecting row or column
    By Middlemarch in forum Access
    Replies: 8
    Last Post: 07-27-2016, 05:02 PM
  2. Listbox - Column Widths issue
    By Ganesh7299 in forum Access
    Replies: 12
    Last Post: 01-09-2014, 09:38 AM
  3. Dsum issue.
    By dniezby in forum Programming
    Replies: 7
    Last Post: 05-19-2013, 10:03 PM
  4. Dsum causing speed issue
    By ethoemmes in forum Queries
    Replies: 0
    Last Post: 07-06-2010, 05:22 AM
  5. Column Chart Issue
    By Sim_ in forum Access
    Replies: 0
    Last Post: 10-26-2009, 01:05 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