Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying the newest record based on date modified

Status
Not open for further replies.

T8JGT

IS-IT--Management
Feb 2, 2005
19
0
0
GB
Hi

I am currently trying to write a query which will display only the latest record for a project e.g.

Project 1 - 01/02/05 <--- Will filter out this record
Project 1 - 02/02/05 <--- Will only display this record

Here is the SQL so far:

SELECT qryProjectDetails.ProjectBusinessArea, qryProjectDetails.ProjectServiceDesigner, tblServiceDesigner.ServiceDesignerExtension, qryProjectDetails.ProjectPAR, qryProjectDetails.ProjectName, qryProjectDetails.ProjectManager, qryProjectDetails.ProjectLiveDate, qryProjectDetails.ProjectRAG, qryReporting.SerRepQualityGateNumebr, qryReporting.SerRepServType, qryReporting.SerRepProjProgress, qryReporting.SerRepDateModified
FROM (tblServiceDesigner INNER JOIN qryProjectDetails ON tblServiceDesigner.ServiceDesignerName = qryProjectDetails.ProjectServiceDesigner) INNER JOIN qryReporting ON qryProjectDetails.ProjectID = qryReporting.ProjectID;
 
something like this ?
WHERE qryReporting.SerRepDateModified=(SELECT Max(SerRepDateModified) FROM qryReporting WHERE ProjectID=qryProjectDetails.ProjectID)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Works a treat!

Many Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top