Solved

MS Access - Update records with last date

Posted on 2009-05-14
6
370 Views
Last Modified: 2012-06-27
Hello,
I have a table with multiple rows of records under the same IDs. There is probably around 20,000 different IDs with about 100'000 rows. What I would need to do is link two tables on these ID numbers, and then find only the newest records from that client. So I would just want to see who approved the account most recently, and on what date? Something like;

UPDATE tbl_Master INNER JOIN tbl_DB_Dump ON tbl_Master.SPN = tbl_DB_Dump.SPN 
SET tbl_Master.Approver = [tbl_DB_Dump].[Signature Name], 
tbl_Master.[Approval Date] = [tbl_DB_Dump].[Signature Time]
WHERE tbl_Master.[Approval Date] = NEWEST DATE.

Open in new window

0
Comment
Question by:andyb7901
[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
  • 4
6 Comments
 
LVL 9

Expert Comment

by:Sander Stad
ID: 24382785
Try this:

SELECT 
  tbl_Master.Aprover, tbl_Master.[Approval Date]
FROM tbl_Master, 
  INNER JOIN tbl_Dump ON tbl_Master.SPN = tbl_Dump.SPN
ORDER BY tbl_master.[Approval Date] DESC

Open in new window

0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 24382807
Why using an update when you want to see records. Are you just looking for the most recent data from tbl_Master for each SPN?

Kelvin
0
 

Author Comment

by:andyb7901
ID: 24382861
Yeah pretty much
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Accepted Solution

by:
Kelvin Sparks earned 500 total points
ID: 24382916
Select tbl_Master.SPN, tbl_Master,Approver, Max(tbl_Master.[Approval Date] FROM tbl_Master GROUP ON tbl_Master.SPN



Kelvin
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 24382925
Not sure what that other table was being used for


Kelvin
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 24382934
You'll probably need a group on for Approver

GROUP ON tbl_Master.SPN, tbl_master.Approver

Kelvin
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…

733 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