Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Query to select last record

Posted on 2008-06-11
3
Medium Priority
?
1,610 Views
Last Modified: 2012-05-05
I have an access database that contains a table (table is Transactions_tbl) for all transactions for all customers.  I need to run a query that will pull only the most recent transaction (field is Transact_Date) for every customer  (field is Customer_ID) in the table.
0
Comment
Question by:sharringtoncpa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 21763526

select *
from Transactions_tbl
where Transact_Date in (select max(Transact_Date) from Transactions_tbl as T  where T.Customer_ID=Transactions_tbl.Customer_ID
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 total points
ID: 21763530
select *
from Transactions_tbl
where Transact_Date in (select max(Transact_Date) from Transactions_tbl as T  where T.Customer_ID=Transactions_tbl.Customer_ID)
0
 

Author Closing Comment

by:sharringtoncpa
ID: 31466309
Thanks capricorn1.  Your solution will save me a lot of time.  Thanks again.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question