Results 1 to 4 of 4
  1. #1
    makro67 is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    2

    Red face How to create a query to return on a single record from a single table

    Good afternoon.


    I am trying to create a query that will be used to generate a report, but I only want the report to display a SINGLE record from a SINGLE table.

    The query and report I can create returns and displays all records for the selected table.....I want to be able to select only the last record added to the table.

    Can somebody please help me?

    Many thanks and kind regards

    Mark

  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
    51,215
    Apply filter criteria. What criteria can be used to determine the 'last' record?
    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
    makro67 is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    2
    Thats what im trying to find out lol. It could be the id number i guess....but how do i set the criteria?

  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
    51,215
    Okay, maybe not a filter as you are familiar with - try TOP n query.

    SELECT TOP 1 table.*,
    FROM table
    ORDER BY ID DESC;

    This assumes ID is always increasing, which is not guaranteed with an autonumber field, although I have never seen otherwise.
    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. Replies: 2
    Last Post: 11-22-2014, 07:50 AM
  2. Replies: 3
    Last Post: 04-17-2013, 07:04 PM
  3. return max/min value in single query
    By garamon in forum Access
    Replies: 2
    Last Post: 10-23-2011, 03:50 PM
  4. Replies: 7
    Last Post: 11-13-2010, 08:08 AM
  5. Create Multiple Charts from Single Table
    By Catch Wrestler in forum Reports
    Replies: 0
    Last Post: 06-17-2010, 08:33 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