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