Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    65

    Unanswered: How to reference the last record in a table

    1) I have a table called "Flyer" with fields FlyerId, FlyerYear, etc. The most current flyer would have the last (the biggest number) FlyerId.

    2) I also have a query with control FlyerId, however not taken from Table "Flyers", but from another Table. I want to run the query with FlyerId = Most current record from Table "Flyer".

    All this is in MS Access, not VB. I tryed to put in the query condition Max([Flyer]![FlyerId]) but it did not work.

    I hope my explanations are clear and someone could help solve this annoing issue.

    Thanks,
    Jazz

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    select foo
         , bar
      from Anothertable
     where FlyerId
         = ( select max(FlyerID)
               from Flyers )
    rudy
    http://r937.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •