Advertisement
bucky_resa

Untitled

Jul 3rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.58 KB | None | 0 0
  1. select concat(c.endYear-1,'-',right(c.endYear,2)) as academicYear, count(distinct cs.personID) as uniqueStudents
  2. from icde.customstudent cs
  3. join icde.campusattribute ca
  4.   on ca.[object] LIKE 'DOE Alt%'
  5.   and ca.[element] = 'doeProgramCode'
  6.   and cs.attributeid = ca.attributeid
  7.   and cs.said = ca.said
  8. join icde.enrollment e
  9.   on cs.personID = e.personID
  10.   and cs.said = e.said
  11. join icde.calendar c
  12.   on e.calendarid = c.calendarid
  13.   and e.said = c.said
  14.   and cs.date between c.startdate and c.enddate
  15. where 1=1
  16.   and cs.said = '664-ICDE'
  17.   and cs.value = '03A'
  18. group by c.endYear
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement