Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:25:04+00:00 2026-06-13T22:25:04+00:00

Good morning. I am currently building a report that features Name, Document type, and

  • 0

Good morning.

I am currently building a report that features Name, Document type, and Expiration Date. The query is based on whether or not the document was ever requested (=yes) and the individual’s role/position. Sadly, due to how the database was designed and how the users have used it, a person may have two roles (Lead Coordinator/Coordinator), and as such, two separate entries (IDs) in the database. However, the users have often only entered in the “Expiration Date” for one of those entries.

Thus, now when I have queries gathering Name, Document, and Expiration Date for each role and then combining them via Union, there may be multiple entries per person, such as:

Smith, John AAA 11-5-2012
Smith, John AAA
Doe, Jane AAA 
Doe, Jane AAA 11-11-2011

Is there a way that I am able to keep the row that has more information?

NOTE I do NOT want to due it based on “Date <> Null” because sometimes we may have requested the document but we have not received it yet to enter the Expiration Date and we need to be able to see this data in case we need to request it once again.

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:25:06+00:00Added an answer on June 13, 2026 at 10:25 pm

    Max and Group By may suit:

    SELECT Docs.Person, Docs.Doc, Max(Docs.DateEntered) AS MaxOfDateEntered
    FROM Docs
    GROUP BY Docs.Person, Docs.Doc;
    

    Where Docs is the name of your table or query.

    Input:

    Person      Doc DateEntered
    Smith,John  AAA 11-5-2012
    Smith,John  AAA 
    Doe,Jane    AAA 
    Doe,Jane    AAA 
    

    Result:

    Person      Doc MaxOfDateEntered
    Doe,Jane    AAA 
    Smith,John  AAA 11-5-2012
    

    Edit re comment

    SELECT doc.Name, doc.Site, doc.Document, Max(doc.Expr1003) AS MaxOfExpr1003
    FROM doc
    GROUP BY doc.Name, doc.Site, doc.Document;
    

    Edit re comment #2

    SELECT 
        ResultsTbl.Name, 
        ResultsTbl.Site, 
        ResultsTbl.Document, 
        Max(ResultsTbl.Expiration_Date) AS Expiration_Date 
    FROM (
        SELECT 
            lname & ', ' & fname AS Name, 
            site_name AS Site, 
            Document, cv_request_expires_on AS Expiration_Date 
        FROM Coord_CV_Expiration 
        UNION SELECT 
            lname & ', ' & fname AS Name, 
            site_name AS Site, 
            Document, 
            cv_request_expires_on AS Expiration_Date 
        FROM LeadCoord_CV_Expiration ...) AS ResultsTbl 
    GROUP BY ResultsTbl.Site, ResultsTbl.Document, ResultsTbl.Name
    ORDER BY ResultsTbl.Expiration_Date;
    

    Note that you should not GROUP By Expiration Date.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good morning, mysql query which displays cases that have a date field completed &
Good morning everyone, I'm currently building a jquery step by step form at: http://jsfiddle.net/xSkgH/
Good morning, I am currently developing a java web application that exposes a web
Good morning. I am currently working on a Java Web Service project, that is
Good morning, I am currently working on a project that utilises Codeigniter and the
Good morning, I am building a website to act as a Foxpro front end.
Good morning gang. I have a jQuery Datepicker object that is prepoulated using a
Good morning, I am currently writing a python library. At the moment, modules and
Good Morning, I have copied this code from somewere <script type=text/javascript> $(function() { setInterval(rotateImages(),
Good morning everybody! (Yeah I know, that not necessary the morning on your side

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.