Results 1 to 3 of 3
  1. #1
    pendlet is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    7

    Querry not working? Tring to use max date to pull only newest records.

    I am trying to pull records that have two criteria <=[ReOrderLevel] based on the newest date the item was inventoried.
    Click image for larger version. 

Name:	Error.PNG 
Views:	7 
Size:	41.5 KB 
ID:	7409


    I get an error every time I run this. Products will be listed numerous times in the inventory table based on when they were last inventoried. It should pull out the newest recorded of each item but only if it’s [TotalQTYinventoried] field is <= [reorderlevel]. The query should not list each product more than once.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Totals queries don't really show the record with raw source data, they return an aggregate calculation of numerous records.
    Instead of Group By under TotalQtyinStock, try WHERE. The result should be ProductName and InventoryDate fields showing.
    Showing the entire record with the TotalQtyinStock values will require subqueries to return the record where InventoryDate is equal to the Max(InventoryDate).
    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
    pendlet is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    7
    Man that makes total sense. I dont know why i did not catch that myslef. It works just like it is suposed to now thanks.

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

Similar Threads

  1. Replies: 15
    Last Post: 04-06-2012, 10:57 AM
  2. Replies: 2
    Last Post: 02-03-2012, 05:06 PM
  3. Replies: 2
    Last Post: 09-13-2011, 11:21 AM
  4. Add & Pull Records from Table via Form
    By sujitshukla in forum Programming
    Replies: 1
    Last Post: 08-02-2010, 05:51 PM
  5. Query From Newest Date
    By SSgtJ in forum Queries
    Replies: 2
    Last Post: 01-21-2010, 01:51 PM

Tags for this Thread

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