Solved

Query to select last record

Posted on 2008-06-11
3
1,603 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 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now