Solved

MS Access - Update records with last date

Posted on 2009-05-14
6
349 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
  • 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

895 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