Results 1 to 5 of 5

Thread: MS access - Most recent Date

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2006
    Location
    Toronto, Canada
    Posts
    41

    Smile MS access - Most recent Date

    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

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: MS access - Most recent Date

    I'm not entirely sure what you want, but this should at least be a good start:

    To get the highest date value:
    Code:
    SELECT Max(ProgressUpdateDate) 
    FROM tablename
    To get this, and the ProgressLog field:
    Code:
    SELECT ProgressUpdateDate, ProgressLog
    FROM tablename
    WHERE ProgressUpdateDate = (SELECT Max(ProgressUpdateDate) FROM tablename)

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2006
    Location
    Toronto, Canada
    Posts
    41

    Angry Re: MS access - Most recent Date

    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

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: MS access - Most recent Date

    For that you can just add an Or to the Where clause, eg:
    Code:
    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)
    OR ProgressUPdateDate Is Null;

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 2006
    Location
    Toronto, Canada
    Posts
    41

    Re: MS access - Most recent Date

    thank you very much

    i really like this forum )

    Pretty gal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width