PS Query & SQL

 View Only
Expand all | Collapse all

I learned something interesting today about apparently identical fields

  • 1.  I learned something interesting today about apparently identical fields

    Posted 7 days ago

    Greetings Friends,

    This is probably old news to a lot of people, but I'm so happy I figured this out that I wanted to share this.

    I have been working on a query to find EmplID from a private loan application.  The loan application contains all of the PII I need to complete the search.

    After converting date of birth from a character field using CCYYMMDD to MM/DD/CCYY using an expression, everything was working fine joining the expression to the date field, but I knew that wasn't nearly a good enough match. 

    I wanted to add a join on last Last Name.  Both fields are character fields, so everything should be fine...but nope!  I got 0 rows returned.

    After a few minutes looking like a confused puppy, I took another look at the Fields tab in Query Manager.  The Last Name fields were, indeed, both character fields, but one is 30 characters long and the other is 35 characters long.

    On a whim, I created an expression for the shorter last name field to create one 35 characters long, joined on the expression, and it worked!

    Here's a screenshot of the expression:

    Thanks for listening!

    Cheers,
    Jessica



    ------------------------------
    Jessica Holler
    Systems Integration Analyst
    DePaul University
    jshisler@depaul.edu
    ------------------------------
    HEUG the mic


  • 2.  RE: I learned something interesting today about apparently identical fields

    Posted 7 days ago
    Jessica,

    Thank you for sharing!  Honestly, I don't remember using the Last name field as a join in any of the queries that I worked on so far.

    Mital Naik

    UT Arlington





    HEUG the mic


  • 3.  RE: I learned something interesting today about apparently identical fields

    Posted 5 days ago

    Other possibilities would have been a LIKE comparison, or TRIMming both sides of the comparison.

    But Mital raises a good point - why were you joining on a name field?



    ------------------------------
    Garrett Fitzgerald
    Senior Analyst Programmer I
    University of Maine
    ------------------------------

    HEUG the mic


  • 4.  RE: I learned something interesting today about apparently identical fields

    Posted 5 days ago

    Hi - 

    The name field which you are using in your expression is a formatted field which does more than just capitalize (it also removes spaces and punctuation, replaces various characters).  Is the field which you are comparing to formatted in a similar manner?



    ------------------------------
    David Ehrlich
    Senior Business Systems Analyst
    Duke University
    ------------------------------

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

    HEUG the mic


  • 5.  RE: I learned something interesting today about apparently identical fields

    Posted 5 days ago

    Hello All,

     

    Yes, after doing some more testing with the query I was using a mixed-case last name field in the join. Heavy sigh...(imagine me blushing with embarrassment).

     

    Oh, well.  The query works and that's what's important, right?

     

    Cheers,

    Jessica

     

     

    Jessica M Holler
    System Integration Analyst | Enrollment Systems | DePaul University

    25 E. Jackson Blvd., Room 1646 | Chicago, IL 60604 | (312) 362-6651 | jshisler@depaul.edu

     




    HEUG the mic


  • 6.  RE: I learned something interesting today about apparently identical fields

    Posted 2 days ago

    If I every try to do a join where I now there is a possibility for mixed case usage, I usually wrap the field in the UPPER() function.  I have even done this with prompts as well.  For example UPPER(:1).



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

    HEUG the mic


  • 7.  RE: I learned something interesting today about apparently identical fields

    Posted 2 days ago
    Edited by Scott Nishizaki 2 days ago

    100% agree, best practice if joining/comparing character fields would be to force them to matching case. You can actually set up the prompt itself to automatically format the input to UPPER for this very reason.



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

    HEUG the mic


  • 8.  RE: I learned something interesting today about apparently identical fields

    Posted 2 days ago
    Something to be aware of if you choose to manipulate the Type, Format, Length and Decimals fields...

    When you select a field via the Field Name look-up, those four fields default to the definition of the field as specified via App Designer.  If you make a change to any of those values - and subsequently do a field name lookup again - those fields will reset to their original definition, even if you select the same field name.  



    David Ehrlich | Senior Business System Analyst - Admissions, Student Records, Data & Reporting

    Duke University | Student Information Services & System (SISS)

    david.ehrlich@duke.edu | 919-684-1270

    www.sissoffice.duke.edu





    HEUG the mic


  • 9.  RE: I learned something interesting today about apparently identical fields

    Posted 5 days ago

    This is great.  Thanks for sharing.



    ------------------------------
    Afroza Shivji
    Senior Business Analyst
    University of Alberta
    ------------------------------

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

    HEUG the mic


  • 10.  RE: I learned something interesting today about apparently identical fields

    Posted 4 days ago

    Thanks for sharing Jessica - one of the great things about this list is being able to review different approaches to the same dilemma. 



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

    HEUG the mic


  • 11.  RE: I learned something interesting today about apparently identical fields

    Posted 2 days ago

    This is very surprising to me, I was under the impression that expression type/length didn't matter when they were used as criteria.  I have, in the past, used EMPLID (for example) but left it as a char 1 and gotten the expected results (matching on EMPLID).



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

    HEUG the mic