[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 580: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 636: sizeof(): Parameter must be an array or an object that implements Countable
Unofficial UNIT-e Forum • TVF_AcademicYear
Page 1 of 1

TVF_AcademicYear

Posted: Thu Mar 02, 2017 10:28 pm
by robinwilson16
Returns the current academic year/session. Input is a date

Code: Select all

CREATE FUNCTION [dbo].[TVF_AcademicYear] (@CurrentDate Date)
RETURNS TABLE
AS
RETURN

SELECT
	Value = SES.s_name
FROM ulive.dbo.capd_session SES
WHERE
	SES.s_type = 'FY'
	AND SES.s_start <= @CurrentDate
	AND SES.s_end >= @CurrentDate