Results 1 to 4 of 4
  1. #1
    BarneyH4 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2013
    Location
    Ohio
    Posts
    5

    Populate Field when result is Null

    I have two tables: Table #1) [Request Table] Customers request our company to stock a certain Part Number with a minimum value. Ajax - P/N "NP4i" - Min "30".
    Table #2) [Sales History] All sales purchased and the "Qty-Total" purchsed. For simplicity Fields are limited.
    I created a CrossTab Query that displays from [Request Table] P/N's requested/ min values (Row Headings) then showing P/N's purchased [Sales History] Value="Qty-Total" Sum and Column=Format([Invoice Date],"mmm/yyyy") group by, showing last twelve months.
    Ex: Customer name, Part Number, Minimum, May/2013, Apr/2013, Mar/2013 and so on.
    AJAX, NP4i, 30 4 21 5 and so on.

    The Crosstab query list only requested Part Numbers that have at least One sale wihin the last twelve months.


    If there are NO sales, the crosstab query will NOT show this Part Number.
    My boss wants to see the requested Part Numbers that were never purchased along with the ones purchased.
    He wants to address the NO sales, yet they requested we stock that particular Part Number for them.

    Is there any criteria I can use to force the Part Number field on the [Request Table] side to populate even though there were NO sales within the last twelve months?
    Thanks, Barney

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Must include the master parts table in a query that joins with the sales table, join type "show all records from parts ...". Then use that query as the source for the crosstab.
    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.

  3. #3
    BarneyH4 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2013
    Location
    Ohio
    Posts
    5
    When I do that, the query runs and list 10,333,000 records.
    [REQUEST TABLE] has 2,621 records whereas [SalesHistory] Table has 455,563 records.
    I am at a loss. Thanks for your help!

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Cannot include both RequestTable and SalesHistory in the query. You stated requirement was to pivot sales. Why would you include RequestTable? My suggestion was to join Parts with SalesHistory and pivot that. Can also do a query that joins Parts with RequestTable and pivot that.
    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. Handling Null DLookup result
    By j6sander in forum Access
    Replies: 1
    Last Post: 07-19-2012, 11:07 AM
  2. Replies: 12
    Last Post: 06-25-2012, 01:42 PM
  3. Null Value for calculation stops whole result
    By Chelcone in forum Queries
    Replies: 11
    Last Post: 04-16-2012, 03:49 AM
  4. Replies: 1
    Last Post: 02-23-2012, 02:27 PM
  5. If Query result Is Null...MsgBox..Okl
    By Bruce in forum Forms
    Replies: 28
    Last Post: 03-10-2010, 10:57 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