Results 1 to 2 of 2
  1. #1
    ShostyFan is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    76

    IIF query

    I have an inventory count query that returns a productCode, the date it was counted, and the total count.
    I have a second query that gives me a productCode, date of sale, and qty sold.



    I need a query that returns the sum of QtySold if the date is greater then the date counted.
    Here is what I have:
    QtySoldSinceCount: Sum(IIf([ReceiptDate]>[MaxDateCount],[sumofQuantity],0))

    I get an error message that I am trying to run a query that does not include "productCode" as part of the aggregate expression.

    I don't understand the error message, nor do I see another way to handle this problem.

  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,770
    Post the entire attempted SQL statement. Or provide db for analysis.
    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.

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