Last active
March 2, 2017 10:21
-
-
Save makoru-hikage/9904c66d6749791e3a3301672f89de46 to your computer and use it in GitHub Desktop.
A query that determines the 1st part (regardless of division type) of an academic year by means of starting and ending date.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @yds = 2016; | |
SET @yde = 2016; | |
SET @type = 'Semester'; | |
SELECT | |
* | |
FROM | |
school_calendar | |
WHERE | |
part_number = 1 | |
AND division_type = @type | |
AND YEAR(date_start) BETWEEN (@yds - 1) AND @yds | |
AND YEAR(date_end) BETWEEN @yde AND (@yde + 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment