PowerSchool: How to query past enrollment
<p>I know this is somewhat of a specialized question since only a small percentage of members will even have heard of PowerSchool, but it's hard to find help for this.  Given a start date and end date, I need to run a query that will return the student ID's for all students who were enrolled in the District during that time period.  If I could use that with 'WITH AS', I could add it to an attendance query 'Where' clause like below. This is what I've got so far, but I don't know how to check it's accuracy:</p>

<pre><code>SELECT * FROM Students 
WHERE ID IN (
    SELECT studentid FROM ps_adaadm_defaults_all 
    WHERE schoolid IN ('16', '28', '40') 
    AND calendardate &gt;= '1-May-15' 
    AND calendardate &lt;= '31-May-15' 
    GROUP BY studentid)
ORDER BY LastFirst;
</code></pre>

<p>"ps_adaadm_defaults_all" is a PowerSchool View that is mainly for ADM so my assumption here is that if a student ID exists in ps_adaadm_defaults_all with a date between the two given dates, that student was enrolled at least that day regardless of attendance, correct?  Any PowerSchool users out there that can lend a hand?</p>

<p>I get results with this query but when I try to verify the accuracy by using the PowerSchool site, the results aren't exactly the same.  What I mean by using the site is I log in as district admin, set Term to 15-16 year, School to desired school and select students whose last names begin with 'A'.  I then start comparing the list it provides with the students from the query results whose last names begin with 'A'.  I am noticing though that there are names that I get with my query that are not showing on the site and I think it's due to their exitdate being prior to the current schoolyear.  Those students were obviously enrolled at that time, but their names aren't in the PowerSchool results.  I'm thinking because they're not enrolled anymore?  Is there any way for me to test the accuracy of this query?  Am I even on the right track?  Thanks in advance.</p>