Click to See Complete Forum and Search --> : ms access - Most recent date


Pretty Gal
January 10th, 2006, 03:17 PM
I need the syntax in SQL (or Criteria) to find the most recent date in a table. table contains IssueID, ProgressLog, and ProgressUpdateDate. I am trying to get most recent ProgressUpdateDate inthe table. IssueId can have more than one progressLog. I need to get most recent progressupdatedate and progresslog in the table.

thanks in advance

Pretty Gal

Vaderman
January 11th, 2006, 04:45 AM
Something that is similar to your needs:
Sort and get first record (http://www.codeguru.com/forum/showthread.php?t=361538&highlight=TOP)

Regards

Pretty Gal
January 11th, 2006, 08:50 AM
SELECT Q.IssueId, Q.ProgressLog, Q.ProgressUPdateDate
FROM tblProgressLog AS Q
WHERE ProgressUPdateDate= (SELECT Max(T.ProgressUPdateDate)
FROM tblProgressLog As T
WHERE T.IssueId=Q.IssueId);


how can i include all the null fields? The syndex above gets only the records have a ProgressUpdateDate. Some of the records i dont have date.
:(

Thanks in Advance

exterminator
January 11th, 2006, 10:12 AM
how can i include all the null fields? The syndex above gets only the records have a ProgressUpdateDate. Some of the records i dont have date.Why do you want to have the records that don't have the date when you want the ones with the most recent date. If you still insist - write another select to get those values with matching columns as this present query and use a UNION clause with those two queries. Hope this helps. Regards.

Vaderman
January 11th, 2006, 10:19 AM
If you still insist - write another select to get those values with matching columns as this present query and use a UNION clause with those two queries. Hope this helps. Regards.

Or, aternatively you can use a right outer join, assuming that you have a 1:M relationship between the tables Q and T.

Regards

Pretty Gal
January 11th, 2006, 11:24 AM
thank you very much

i really like this forum :)):)

Pretty gal