Results 1 to 2 of 2
  1. #1
    sharkantipav is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    3

    SumIF in access

    Hello All,


    I am a newbie, in Access programming.
    I have created a database with 10 tables - 5 tables reporting sales of 5 differents product and 5 statics tables (customers, salesman, billing...)
    In 5 first table I have some fields that are the same names Broker1 Broker2 Date CMSN1 CMSN2
    The field Broker1-2 can take 5 different value A B C D E
    I want to create a form where I can select a date or a range of date
    Then calculate for each broker Sumif Broker = A, CMSN1+CMSN2 etccc and display as an array
    Thank you very much

  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,626
    Each product has its own table? Are the fields the same for all? Should be one table.

    Multiple similar name fields indicates a non-normalized data stucture and usually makes what you want difficult to accomplish. You have only 2 fields for brokers? You have 5 brokers? You want to sum by broker name/ID? If you hard code this then what if the brokers change (people come and go)? Will have to modify code.

    A UNION query can rearrange the broker data to a normalized structure then use that query to summarize by broker. There is no wizard for UNION, must type or copy/paste into SQL View of query builder.

    SELECT ID, Broker1 As Broker FROM table
    UNION SELECT ID, Broker2 FROM table;
    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. SumIF Function?
    By LeoGets in forum Access
    Replies: 13
    Last Post: 01-22-2014, 06:39 PM
  2. SumIF Statement in Query
    By athyeh in forum Queries
    Replies: 2
    Last Post: 09-09-2013, 04:25 PM
  3. sumif in Access
    By JGrots in forum Queries
    Replies: 12
    Last Post: 01-17-2013, 02:37 PM
  4. Lookup and Sumif
    By hatimn in forum Queries
    Replies: 7
    Last Post: 07-18-2011, 11:50 AM
  5. Sumif in an Access report
    By tigers in forum Reports
    Replies: 0
    Last Post: 03-15-2007, 12:19 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