PS Query & SQL

 View Only
  • 1.  Help Writing a Query for a Data Feed

    Posted 06-04-2026 10:09 AM

    Hello Friends,

    We are working on a project where the student account activity details (from the student center) need to be shared with a third-party vendor so they can replicate this detailed summary in their system. 

    I am very new to writing queries for student financials and have been diving into the records and data over the last couple of days. I know that I need to use ITEM_SF and ITEM_LINE_SF, and I can see the matching data (Posted Date, Item, Term, Charge, Payment, Refund). 

    The struggle now becomes how to align the information to the appropriate column, for "Charge", "Payment", "Refund." My experience in PS tells me that there must be some type of code or identifier that I need to tie in to determine how these amounts should apply to the columns. But I don't know where to start with this.

    Any guidance is appreciated.

    SELECT TO_CHAR(B.POSTED_DATE,'YYYY-MM-DD'), B.DESCR, B.ITEM_TERM, B.LINE_AMT
      FROM PS_ITEM_SF A, PS_ITEM_LINE_SF B
      WHERE ( A.BUSINESS_UNIT = B.BUSINESS_UNIT
         AND A.COMMON_ID = B.COMMON_ID
         AND A.ITEM_NBR = B.ITEM_NBR
         AND B.EMPLID = '12345678'
         AND B.ITEM_TERM = '1263')
      ORDER BY 1 DESC



    ------------------------------
    Lidia Anderson
    Manager, Campus Solutions
    Central Washington University
    lidia.anderson@cwu.edu
    ------------------------------
    HEUG ANZ - Brisbane, 9-10 September 2026


  • 2.  RE: Help Writing a Query for a Data Feed

    Posted 06-04-2026 10:27 AM
    Hey Lidia!

    I think the information you're seeking will be found in the ITEM_TYPE_TBL.  The field ITEM_TYPE_CD corresponds to the "classification" area on the SF setup, as shown below:

    image.png

    An ITEM_TYPE_CD of P = Payment, C = Charge, and R = Refund, at least it is at our institution.  I think you if did an outer join of this information to the ITEM_SF table, matching it to the ITEM_TYPE field, then you'll be able to get these indicators.

    I'm no query master though, so I defer to those who are way smarter about this stuff than I am :-).

    -Jamie

    Jamie Pendergrass
    Associate Director
    North Carolina State University
    Office of Scholarships and Financial Aid
    2016 Harris Hall, Box 7302
    Raleigh, NC 27695-7302
    P: 919-515-NCSU (6278)
    F: 919-515-8422



    All electronic mail messages in connection with State business which are sent to or received by this account are subject to the NC Public Records Law and may be disclosed to third parties.



    HEUG ANZ - Brisbane, 9-10 September 2026


  • 3.  RE: Help Writing a Query for a Data Feed

    Posted 06-04-2026 11:00 AM

    Good morning Lidia,

    I'm not sure if your question was just about criteria for determining what the B.LINE_AMT "type" was for each row (Charge, Payment, Refund), or if it was also about report formatting to match the needs of your vendor. I can't help with the first, as I only work in HCM (on the employee payroll/benefits side of Oracle). 

    But I can offer some help if your question is about formatting the report for a vendor.

    For fields that return a value whose purpose or meaning is determined by another field value (ie. a $$$ amount that corresponds to a specific type of Charge or Earn_Code, etc), where you cannot simply add a "Description" column, you can use the field in a CASE expression and return that expression as a field.

    For example:

    (CASE

    WHEN C.ITEM_TYPE_CD = 'P'

    THEN B.LINE_AMT

    ELSE ' '

    END)

    AS Payment

    When used as a field, this expression would result in a column titled "Payment" where the $$$ amounts are only payments. You would then create additional expressions where C.ITEM_TYPE_CD was equal to C, R, etc. (assuming that's correct) and use those as fields to create their respective columns. I don't know the SQL for setting the field type or width for an expression since I normally work in PSQuery. But I'm sure someone else in the community can help with that part if you need it.

    Hope this helps,

    Scott Frey

    Senior Data Analyst-HRIS, Employee Services

    University of Colorado

    1800 Grant Street, Suite 400

    Denver, CO  80203

    t  303 860 4200

    Scott.Frey@cu.edu
    www.cu.edu

    A black text on a white background

AI-generated content may be incorrect.



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

    HEUG ANZ - Brisbane, 9-10 September 2026


  • 4.  RE: Help Writing a Query for a Data Feed

    Posted 06-05-2026 04:52 PM
    Hi Lidia -

    Jamie was spot on by pointing to the field ITEM_TYPE_CD.  It also happens that the code is written to items in ITEM_SF, so you don't have to go to ITEM_TYPE_TBL to fetch the value.  They also happen to be used in Translate Values.  Here is a summary of their values:
    Field valueXlat long nameXlat short nameDR/CR
    AApplication FeeApp FeeDR
    BBilling OnlyBillingN/A
    CChargeChargeDR
    DDepositDepositCR
    FFinancial AidFin. AidCR
    GGL Interface OnlyGL OnlyN/A
    HWithholdingWithhold??
    IInterestInterestDR
    LPre-Paid TuitionPre-paidCR
    PPaymentPaymentCR
    RRefundRefundDR
    TTransfersTransfers??
    VContributor RelationsCR??
    WWaiverWaiverCR
    XWrite-offWrite-offCR
    ZPay Plan CreditCreditCR

    I added the DR/CR column.  On the financial accounting side there will be both a debit and a credit; the list here shows whether the item will be a debit or a credit to student accounts receivable.

    Here is how to query the table directly:
    SELECT FIELDNAME, FIELDVALUE, XLATLONGNAME
    FROM PSXLATITEM
    WHERE FIELDNAME = 'ITEM_TYPE_CD' ;

    PS Query will do this for you automagically if you select a translatable field in your query, it just takes a couple clicks in Query Manager.

    image.png


    Ray Martin  |  Oracle Database Administrator
    Information Technology, Azusa Pacific University
    568 E Alosta Ave, Azusa, CA 91741
    office: (626) 815-2149 | apu.edu
    cell (626) 629-6536

    'What no eye has seen, what no ear has heard,
    and what no human mind has conceived'-
    the things God has prepared for those who love him.

    – 1 Corinthians 2:9b (NIV)





    HEUG ANZ - Brisbane, 9-10 September 2026