UFN_GET_SCHOOL_TERM_BYDATE
Returns the ID of the term for a school starting and ending on the given dates.
Return
Return Type |
---|
uniqueidentifier |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@SCHOOLID | uniqueidentifier | IN | |
@STARTDATE | date | IN | |
@ENDDATE | date | IN |
Definition
Copy
create function dbo.UFN_GET_SCHOOL_TERM_BYDATE(
@SCHOOLID uniqueidentifier,
@STARTDATE date,
@ENDDATE date
)
returns uniqueidentifier
with execute as caller
as begin
return (
select
TERM.ID
from
dbo.ACADEMICYEAR
join
dbo.SESSION on SESSION.ACADEMICYEARID = ACADEMICYEAR.ID
join
dbo.TERM on TERM.SESSIONID = SESSION.ID
where
ACADEMICYEAR.SCHOOLID = @SCHOOLID
and TERM.STARTDATE = @STARTDATE
and TERM.ENDDATE = @ENDDATE
)
end