Results 1 to 3 of 3
  1. #1
    jamtrad is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2012
    Posts
    4

    Duplicate madness

    The table below contain 12 different stores (Str) and thousands of Items. I trying to build a supply and demand query whch will show all the stores that have not sold and item but have it demand, and show me all the stores that have sold and items and have none on demand. Kind of a supply and demand. So the result would be store 1 have item 12352 and needs to send it to store 2.



    Hopes this makes send

    Table headings from data table

    Code:
    SELECT [Tbl Data].Str, [Tbl Data].[Item#], [Tbl Data].[O/H], [Tbl Data].SOLD, [SOLD]-[O/H] AS Expr1, [Tbl Data].[primary Key]
    FROM [Tbl Data];

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Query 1 - use the "Totals" button - group by store and item, sum Sold and OH - criteria Sold>0 and OH=0

    Query 2 - same - criteria is Sold=0 and OH>0

    Now link the two queries by item number, showing both stores and the OH. You are going to have to deal with the duplicates somehow.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Also, do NOT use field names with special characters - use only alphas and underscore.

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

Similar Threads

  1. Possible Duplicate Help
    By dave559 in forum Programming
    Replies: 0
    Last Post: 02-22-2011, 08:01 PM
  2. Duplicate a row
    By thestappa in forum Programming
    Replies: 3
    Last Post: 06-01-2010, 02:37 PM
  3. Filtering Madness
    By Kipster1203 in forum Reports
    Replies: 18
    Last Post: 05-25-2010, 10:59 AM
  4. Duplicate first row
    By kruai in forum Access
    Replies: 1
    Last Post: 06-22-2009, 02:06 PM
  5. Which duplicate?
    By grgerhard in forum Import/Export Data
    Replies: 1
    Last Post: 05-27-2006, 06:19 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