JBAS-1037 Student E-cards quick report SQL
authorBill Erickson <berickxx@gmail.com>
Wed, 2 Dec 2015 18:03:38 +0000 (13:03 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/utility-scripts/import_students/ecards-created-today.sql [new file with mode: 0644]

diff --git a/KCLS/utility-scripts/import_students/ecards-created-today.sql b/KCLS/utility-scripts/import_students/ecards-created-today.sql
new file mode 100644 (file)
index 0000000..877121c
--- /dev/null
@@ -0,0 +1,40 @@
+/*  Generate a list of student cards created today.
+    Useful for debugging and sharing with staff.  */
+
+SELECT 
+    au.id, 
+    ac.barcode,
+    au.usrname, 
+    au.first_given_name, 
+    au.second_given_name, 
+    au.family_name,
+    au.profile, 
+    au.juvenile,
+    au.ident_type, 
+    au.home_ou, 
+    au.net_access_level,
+    au.ident_value, 
+    au.create_date,
+    au.expire_date, 
+    au.dob,
+    au.day_phone,
+    au.email,
+    aua.street1, 
+    aua.street2, 
+    aua.city, 
+    aua.post_code, 
+    aua.state, 
+    aua.county, 
+    aua.country, 
+    aua.within_city_limits, 
+    aua.valid
+FROM actor.usr au 
+    JOIN actor.card ac ON (ac.id = au.card)
+    JOIN actor.usr_address aua ON (aua.id = au.mailing_address)
+WHERE 
+    au.profile = 901 AND 
+    DATE(au.create_date) = CURRENT_DATE
+ORDER BY au.usrname;
+
+
+