[moinfinitecampus] Snow Day Scripts

For those that have access to the database, here's a view that brings up the
specified day for all active calendars and and update query that will change
the instruction, attendance, schoolDay and comments fields in the day table
for snow days. I could've used GETDATE, but I think it's safer this way if
you forget to change the date, or want to run the script a day or two early.
Feel free to change the query name, just be sure you change it in the update
query.

If anyone has a building with a day rotation that has to be changed after a
snow day, let me know and I can send that out as well.

Regards,

Terry Carr
Belton School District #124
816.348.1174


The View:
/*  z_tdc_snowDay_allBldgs - selects all the current non-summer school
calendars for specified date so can set dbo.day.instruction,
dbo.day.attendance, and dbo.day.schoolDay == 0 and dbo.day.comments == 'Snow
Day'
Change the date in the view, save the view, run the view, if you're happy
with the results, run the update/stored procedure.
*/

SELECT     dbo.Day.dayID, dbo.Day.calendarID, dbo.Day.structureID,
dbo.Day.periodScheduleID, dbo.Day.[date], dbo.Day.instruction,
dbo.Day.attendance,
                      dbo.Day.schoolDay, dbo.Day.duration, dbo.Day.comments,
dbo.Day.startTime, dbo.Day.endTime, dbo.Calendar.name, dbo.SchoolYear.active
FROM         dbo.Day INNER JOIN
                      dbo.Calendar ON dbo.Day.calendarID =
dbo.Calendar.calendarID INNER JOIN
                      dbo.SchoolYear ON dbo.Calendar.endYear =
dbo.SchoolYear.endYear
WHERE     (dbo.Day.[date] = CONVERT(DATETIME, '2010-01-07 00:00:00', 102))
AND (dbo.Calendar.summerSchool = 0) AND (dbo.SchoolYear.active = 1)

The Stored Procedure:
/*
Updates instruction, attendance and schoolDay = 0 and comments = 'Snow Day'
- the stored procedure is named 'z_tdc_snowDay_allBldgs_update'
*/

update z_tdc_snowDay_allBldgs
set instruction = 0, attendance = 0, schoolday = 0, comments = 'Snow Day'

Other related posts: