Skip to main content
ExLibris

Knowledge Assistant

BETA
 
  • Subscribe by RSS
  • Back
    Aleph

     

    Ex Libris Knowledge Center
    1. Search site
      Go back to previous article
      1. Sign in
        • Sign in
        • Forgot password
    1. Home
    2. Aleph
    3. Knowledge Articles
    4. SQL for locating patrons with specific ID-type and loans in specific time period

    SQL for locating patrons with specific ID-type and loans in specific time period

    1. Last updated
    2. Save as PDF
    3. Share
      1. Share
      2. Tweet
      3. Share
    No headers
    • Article Type: General
    • Product: Aleph
    • Product Version: 20

    Description:
    I need to

    select Z308_REC_KEY from z308 where Z308_REC_KEY like ‘07%’;

    but only for those patrons that do have at least one loan between jan 12,2012 and April 30,2012

    Resolution:
    I believe that this will give you what you want:

    SQL> select unique z35_id from z35 where z35_event_type like '5%' and z35_event_date > '20120111' and z35_event_date < '20120431' and z35_id in (select z308_id from usr00.z308 where z308_rec_key like '07%');

    (you will need to change the "usr00" to your $usr_library -- unless it's your ADM library, in which case you can omit it).


    • Article last edited: 10/8/2013
    View article in the Exlibris Knowledge Center
    1. Back to top
      • SQL for Loans by title in a specific time range
      • SQL for OPAC statistics (using z69 OPAC-event table)
    • Was this article helpful?

    Recommended articles

    1. Article type
      Topic
      Language
      English
      Product
      Aleph
    2. Tags
      1. 20
      2. contype:kba
      3. Prod:Aleph
      4. Type:General
    1. © Copyright 2025 Ex Libris Knowledge Center
    2. Powered by CXone Expert ®
    • Term of Use
    • Privacy Policy
    • Contact Us
    2025 Ex Libris. All rights reserved