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
Solved

Query to select last record

Posted on 2008-06-11
3
1,606 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
  • 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 250 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

808 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