~[wc:commonscripts]
"Student Id","FRN" ~[TLIST_SQL; SELECT REPLACE(s.student_number, '"', '""'), REPLACE(s.DCID, '"', '""') FROM students s, schools ss WHERE s.student_number IS NOT NULL AND s.last_name IS NOT NULL AND (s.enroll_status = 0 OR s.enroll_status = -1) AND s.schoolid = ss.school_number ORDER BY s.student_number ~[if.~(gpv.offset)=] OFFSET 0 ROWS FETCH NEXT 50000 ROWS ONLY [else] OFFSET ~(gpv.offset) ROWS FETCH NEXT 50000 ROWS ONLY [/if] ]"~(1;T)","~(2;T)" [/TLIST_SQL]