TVF_AcademicYear

The list of table valued functions used by Guildford College Reports and any anyone else wishes to share
Post Reply
User avatar
robinwilson16
Site Admin
Posts: 185
Joined: Sun Oct 16, 2016 6:46 pm
Forename: Robin
Surname: Wilson
College Name: FEA
Position: MIS Consultant
LinkedIn Profile: https://www.linkedin.com/in/robinwilson16

TVF_AcademicYear

Post by robinwilson16 » Thu Mar 02, 2017 10:28 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests