PS Query & SQL

 View Only
  • 1.  How do you find a "Max date"?

    Posted 01-16-2025 05:10 PM
    Edited by Shawn Massey 01-16-2025 05:19 PM

    The issue arises when something that doesn't have an effective date field has multiple rows returned with same information but different dates. 

    What PeopleSoft Friendly expression or solution have you found usable in Query Manager?   



    ------------------------------
    Shawn Massey
    Financial System Analyst
    University of Oklahoma
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!


  • 2.  RE: How do you find a "Max date"?

    Posted 01-17-2025 07:08 AM

    I do an equal to subquery and select the date field, select max on the edit for the field, do your normal joins.

    Here's an example for STDNT_AWRD_ACTV:

    SELECT A.EMPLID, TO_CHAR(CAST((A.ACTION_DTTM) AS TIMESTAMP),'YYYY-MM-DD-HH24.MI.SS.FF'), A.ITEM_TYPE, A.ACAD_CAREER
      FROM PS_STDNT_AWRD_ACTV A
      WHERE ( A.ACTION_DTTM = (SELECT MAX( B.ACTION_DTTM)
      FROM PS_STDNT_AWRD_ACTV B
      WHERE B.EMPLID = A.EMPLID
         AND B.INSTITUTION = A.INSTITUTION
         AND B.AID_YEAR = A.AID_YEAR
         AND B.ITEM_TYPE = A.ITEM_TYPE
         AND B.ACAD_CAREER = A.ACAD_CAREER)
         AND A.AID_YEAR = '2025')



    ------------------------------
    Dana Pawlowicz
    Business Systems Analyst Sr - ERP
    University of Cincinnati
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!


  • 3.  RE: How do you find a "Max date"?

    Posted 01-17-2025 10:51 AM

    I believe this Subquery is the ticket I have been trying to find.  I am going to file this away for the future.  Thank you!



    ------------------------------
    Shawn Massey
    Financial System Analyst
    University of Oklahoma
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!


  • 4.  RE: How do you find a "Max date"?

    Posted 01-17-2025 08:20 AM
      |   view attached

    Shawn, we are currently building out the library with presentations (this list is only a day old, so coming soon...), but I'm attaching a presentation I attended from Alliance 2024 that goes into detail about querying dates.



    ------------------------------
    Dana Pawlowicz
    Business Systems Analyst Sr - ERP
    University of Cincinnati
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Attachment(s)

    Alliance 2026 Registration is Open!


  • 5.  RE: How do you find a "Max date"?

    Posted 01-17-2025 10:18 AM

    Dana,

    I have added the presentation you attached to the Resource Center under PS Query > Presentations > Alliance 2024.



    ------------------------------
    Daniel Labrecque
    Senior 2 Business Systems Analyst/Functional Architect
    University of Nevada, Las Vegas
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!


  • 6.  RE: How do you find a "Max date"?

    Posted 01-21-2025 05:46 PM

    That is a good resource of information. Thanks for sharing it!



    ------------------------------
    Enrique Pizana
    PeopleSoft Developer and Support Engineer
    Washington State Board for Community and Technical Colleges
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!


  • 7.  RE: How do you find a "Max date"?

    Posted 01-22-2025 01:32 AM

    Thanks, Dana. This presentation is very helpful!



    ------------------------------
    Tirumala Rao Chimpiri
    Senior Programmer Analyst
    Stony Brook University
    ------------------------------

    Message from the HEUG Marketplace:
    ------------------------------
    Find, Review, and Engage with Higher Education-focused solution providers, products, and services using the HEUG Marketplace.
    ------------------------------

    Alliance 2026 Registration is Open!