Results 1 to 6 of 6
  1. #1
    josnghi is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    6

    Find records with sooner Expiry Date (FEFO regulation)


    Please see the table inventory below

    Material
    BUn
    Good Rec Date
    Batch
    Unrestricted
    Expiry Date
    300008
    KG
    09/04/2015
    0000033574
    32,000
    18/01/2017
    300008
    KG
    14/05/2015
    0000033927
    24,725
    15/02/2017
    300008
    KG
    03/06/2015
    0000034121
    24,725
    02/11/2016
    300058
    KG
    04/06/2015
    0000034155
    6,300
    05/02/2017
    300058
    KG
    06/06/2015
    0000034168
    36,000
    08/02/2017
    300058
    KG
    09/06/2015
    0000034214
    24,975
    07/04/2017
    300058
    KG
    09/06/2015
    0000034218
    10,800
    08/04/2017

    I want to find the records at the same material which have the greater Batch but sooner Expiry Date (the records highlighted above) so that we can issue by FEFO (First Expiry First Out) regulation. The table have large records so we can not find out manually
    I try to use the DLookup in the Query but the results is not correct
    Could you please help me?
    Thanks in advance
    Last edited by josnghi; 07-04-2015 at 09:09 PM. Reason: Highlighted the record

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    why use Dlookup in query ? Simply sort in ascending order of the Expiry date in your query.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Perhaps there is more to the story than you have provided in your post.
    amrut seems to have the answer for identifying ExpiryDates in Date sequence.

  4. #4
    josnghi is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    6
    Thanks you for Amrut and Orange's advice. Currently, Our system (SAP) sort out by Batch as default so that we can issue by FIFO (First in First Out). But sometime we have to find records with sooner Expiry Date to follow FEFO manually. I export data from SAP to excel then inport data to access as table above to find out records with sooner Expiry Date. I used to sort in ascending order of Expiry Date in access to find records with sooner Expiry Date. But it is difficult for me to find records sorted ascending order by Batch in the database with large records. Do you have any idea help me. Thanks you very much

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Still not clear to me what you want. The example shows only one record desired for material 300008. Nothing for material 300058. If you want the most recent record for each group (material?), review: http://allenbrowne.com/subquery-01.html#TopN
    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.

  6. #6
    josnghi is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    6
    Thanks you for June7's advising me to review subquery. The example shows only one Batch 0000034121 of material 300008 needed to find, the material 300058 is being followed the FIFO and FEFO. So no need to find material 300058. The database have large materials. Each material have large Batches. I try to find Batches with sooner Expiry Date for the whole database. Thanks so much

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

Similar Threads

  1. query expiry to show just out of date
    By richard_rendle1972 in forum Queries
    Replies: 1
    Last Post: 03-16-2015, 02:55 PM
  2. Parameter coming up for expiry date
    By FranCorona in forum Queries
    Replies: 2
    Last Post: 08-09-2013, 09:59 AM
  3. expiry date query help
    By graemespence1 in forum Queries
    Replies: 3
    Last Post: 11-22-2011, 09:23 PM
  4. Calculating Expiry Date -
    By Jojojo in forum Programming
    Replies: 12
    Last Post: 10-05-2011, 12:05 PM
  5. Query to find all records after a certain date
    By Matt Parsons in forum Queries
    Replies: 2
    Last Post: 08-24-2011, 06:22 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