PS Query & SQL

 View Only
Expand all | Collapse all

PSQuery: Outer Joins and Effective Dates Error

  • 1.  PSQuery: Outer Joins and Effective Dates Error

    Posted 08-14-2025 10:10 AM
      |   view attached

    There is a strange bug that occurs for us in PSQuery, and I wanted to create a post about it for 2 reasons:

    1. To confirm that it isn't something specific to how we are setup that is causing it (we have a lot of mods)
    2. To raise awareness in case it causes issues for other folks

    The Issue: Most of us who work in PSQuery are likely familiar with the automatic subqueries that are written to help return the most recent row in records that have an EFFDT (effective date) field - a feature I am thankful for!  However, I have noticed that when outerjoining two records that both have an EFFDT field, that the automatic logic does not work correctly.  The second EFFDT gets set to <= the first EFFDT instead of being set to <= SYSDATE. Example below:

    This is a screenshot I took after outerjoining the record, PS_STDNT_FA_TERM to  PS_ADM_APPL_PROG - two records with unrelated effective dates. I can't think of many scenarios where this would be the desired outcome. 

    Most of the time, you will need to assign the criteria to the correct ON clause, so you can easily fix expression 2 while you are in there. But honestly, it is kind of easy to miss...

    So yeah, are any of you seeing this behavior in your system? I found some instances in our system that look to be the result of this issue in our system. I am attaching the SQL in case anyone cares to run it in SQL developer or your preferred tool.

    Thanks!

    Jeffrie



    ------------------------------
    Jeffrie Brooks
    BSA
    University of Michigan
    ------------------------------

    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: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-14-2025 10:16 AM

    Yeah, we have that too.  I just know to manually fix it.  And remind everyone to add that outer join.  Not sure why they don't do the outer join part.


    Sometimes regular joins get messed up with effective dates too so I always make sure to double check it.

     




    Alliance 2026 Registration is Open!


  • 3.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-14-2025 10:17 AM

    Hi Jeffrie –

     

    Yes, I have seen this for years, and always just told folks to avoid it. 

     

    Thanks!

     

    Vic

    ---

    Vic Goldberg

    Retiree, Temporary Employee

    University of Colorado Boulder

    Independent PeopleSoft FA Consultant

     

     




    Alliance 2026 Registration is Open!


  • 4.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-14-2025 10:48 AM

    Hi

     

    Yep, not really sure why it's designed like that but by default I always amend it if needed.

     

    You always have to go in and make the Effective Date join an outer join anyway because for some strange reason it doesn't do that automatically – so I'm just pre-programmed now to change both things immediately!

    Typical PeopleSoft though – does something odd because it knows it's an outer join but doesn't do the thing it actually should do!

     

    Phil

     

     

     

    University of Derby

     

     

    Phil Sugden

     

    Head of Registry Systems Enhancement
    The Registry

    01332 591053
    p.sugden@derby.ac.uk

     

     

     

     




    Alliance 2026 Registration is Open!


  • 5.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 06:49 AM

    Hey Jeffrie - just as others have said, I've encountered this issue for years. 

    I also try to be conscious of a related auto-join issue where Effective Sequence fields are auto-joined, resulting in a similar problem.  For example, I try to be particularly aware of this is when joining ACAD_PROG to ACAD_PLAN.  These two records both contain effective dates and effective sequence fields, and Query Manager will try to auto-join on them.  But, just like the Eff Dates, the Eff Sequence numbers are for totally different sequences, and joining on them results in incomplete data returned.  

    I supposed we can just say this is all Eff'ed up...  



    ------------------------------
    Tom Johnson
    Sr Business Systems Analyst
    Duke University
    tom.johnson@duke.edu
    "None of us is as smart as all of us"
    ------------------------------

    Alliance 2026 Registration is Open!


  • 6.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 07:17 AM

    Ha!  Eff'ed up!  I LOVE it! 

     

    If we ever do pins again, we need this one!

     




    Alliance 2026 Registration is Open!


  • 7.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 08:35 AM

    This could make a great presentation title for the upcoming Alliance...

     

    All Eff'ed Up! – Effective Dates, Effective Sequences, and other Surprises in Query Manager

    Quit Eff'ing Around – Tips and Tricks to take your use of Query Manager to a New Level

    Eff This!  How to write effective queries using Query Manger

     

    Seriously, this stuff almost writes itself.  (I did not use AI to help me, either.)  😊

     

    Tom Johnson

    tom.johnson@duke.edu

     

    **None of us is as smart as all of us **

     




    Alliance 2026 Registration is Open!


  • 8.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 08:37 AM

    Those are spectacular titles! I'm very impressed!!!

     




    Alliance 2026 Registration is Open!


  • 9.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 09:03 AM
    Ha! Tom, these really are gold! Perhaps another webinar is in your future? ��

    I will say that the effective sequence issue is a little more palatable to me, because you are given the option to change it during the join step. Whereas with effective date it just incorrectly assumes the wrong join.

    My M.O. for these has just been to set the condition type to "Last EFF Date" unless I know that there could be an issue with future dated rows. Pat Wooley told me to do that years ago, and I assume her reason for that was to avoid this bug.

    Thanks for all the useful responses! (despite my deranged formatting issues)

    Jeffrie

    --
    Jeffrie Brooks | BUSINESS SYSTEM ANALYST
    UNIVERSITY OF MICHIGAN | INFORMATION AND TECHNOLOGY SERVICES
    734-647-8763 | jedobr@umich.edu



    Alliance 2026 Registration is Open!


  • 10.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 09:20 AM

    While it seems like the problem is known and there are workarounds, is it worth getting Oracle to correct this behavior? Do we want to submit an Ideas Lab request? Can we all agree on what the specific changes should be?



    ------------------------------
    Kevin Shalla
    Director of Technology
    University of Chicago
    ------------------------------

    Alliance 2026 Registration is Open!


  • 11.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 09:30 AM

    Part of me says yes.  And part of me likes it how it is because it forces you to double check your criteria.  I could go either way.

     

    But, speaking of Idea Labs.  I do have a query related one.  If you could all vote/comment, I'd appreciate it.  This is a HUGE pet peeve of mine.  When running queries with the HTML link and they have prompts and you want to run it multiple times with different values, it doesn't clear out the results from the prior run when you click the RUN button.  😊

     

    https://community.oracle.com/mosc/discussion/4555572/ps-query-html-view-clear-results-when-running-with-new-parameters

     




    Alliance 2026 Registration is Open!


  • 12.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 09:54 AM

    Yes, definitely a bad PS Query design issue. 

     

    Does anyone ever know if those issues have ever been reported to Oracle as bugs?  I've been working with PeopleSoft since the mid 90's and the outer join issue where they don't place the Effective Dated Subquery in the outer join logic which basically invalidates the purpose of doing an outer join has been around as far back as I can recall.  I just assumed that someone had reported it, but maybe it has never been addressed because we all just live with it.

     

    Mark Miszewski

    CIT/OUR Senior PeopleSoft Developer

    Email:  mjm624@cornell.edu

    Chat:   mjm624@cornell.edu" title="Chat with Me">MS Teams Chat

    W: 1-607-254-8235

    M: 1-920-737-0840

     




    Alliance 2026 Registration is Open!


  • 13.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 10:25 AM

    Hello all,

    In our Resource Center which is in the Library for this group, there is a presentation from Alliance 24 called As of When? Understanding Date, Time, and Effective Date in HCM & Queries



    ------------------------------
    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!


  • 14.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 11:43 AM

    It's been this way for at least 13 years.

    Oracle assumes that the MAX row we want to see is on the main record (A). And we usually would not want to see any row on the outer-joined record (B) that exceeds the EffDt of that row since it would not yet be in effect  (i.e. it would be future-dated as of the EffDt of the row on the main record, for each corresponding employee or student or whatever).

    So, PSQuery creates the autojoined criteria:

    A.EffDt   EffectiveDate<=   Current Date 

    B.Effdt   EffectiveDate<=    A.Effdt

    If MAX(A.EffDt) happens to be SYSDATE, then MAX(B.EffDt) will also be SYSDATE  ...but, only where A.Effdt is. 

    There are many occasions where always want the most recent data from the B.record no matter what the EffDt of the A.row is. In that case, we would need to manually modify the B.EffDt criteria to:

    B.EffDt     EffectiveDate<=    Current Date,   left-outer-join on B

    FYI: This is very useful when you're looking for EEs or students that "had an 'X' between date1 and date2" and you need their current Name or Mailing Address, etc. so somebody can contact them.



    ------------------------------
    Scott Frey
    Senior Data Analyst - Human Resource Information Systems
    University of Colorado System
    ------------------------------

    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!


  • 15.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 01:27 PM

    Thanks for weighing in, @Scott Frey. I plugged your presentation above.  Perhaps you would be interested in doing a webinar on this in the future?



    ------------------------------
    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!


  • 16.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 04:01 PM

    While this is certainly an annoying reality, having to change the criteria to be part of the outer join,  I believe this is to avoid the "cannot outer join on a subquery" SQL error.  In fact, I believe that EFFDT and EFFSEQ are two of the very rare (if not only) exceptions to this error, and even then is database dependent.  Rather than risk having users attempt to run the query only to encounter a SQL error, they make us go in and make the change ourself.  



    ------------------------------
    Scott Nishizaki
    Developer/Analyst
    Azusa Pacific 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!


  • 17.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 04:12 PM
    Scott Nishizaki,

    Can you elaborate on this? I frequently  outer join subqueries, and I I don't recall seeing this error in recent memory.

    Thanks!

    --
    Jeffrie Brooks | BUSINESS SYSTEM ANALYST
    UNIVERSITY OF MICHIGAN | INFORMATION AND TECHNOLOGY SERVICES
    734-647-8763 | jedobr@umich.edu



    Alliance 2026 Registration is Open!


  • 18.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 05:13 PM

    Wow, congratulations on dodging that one.  It for sure was more prominent in the past, but here's some links I found regarding it:


    https://forums.oracle.com/ords/apexds/post/another-ora-01799-a-column-may-not-be-outer-joined-to-a-sub-4385
    https://stackoverflow.com/questions/14571254/ora-01799-a-column-may-not-be-outer-joined-to-a-subquery



    ------------------------------
    Scott Nishizaki
    Developer/Analyst
    Azusa Pacific 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!


  • 19.  RE: PSQuery: Outer Joins and Effective Dates Error

    Posted 08-15-2025 04:20 PM
    Scott Frey,

    Thank you for this perspective!

    I do question the logic behind Oracle's assumption, primarily because that assumption causes an exception to how that function normally behaves.

    Anyway, it sounds like "it's a feature - not a bug" from Oracle's perspective. That, and it sounds like it works better this way in certain scenarios (not to mention folks are used to it). So it sounds like an SR or ideas lab might not be too fruitful.


    --
    Jeffrie Brooks | BUSINESS SYSTEM ANALYST
    UNIVERSITY OF MICHIGAN | INFORMATION AND TECHNOLOGY SERVICES
    734-647-8763 | jedobr@umich.edu



    Alliance 2026 Registration is Open!