UFN_EDUCATIONALHISTORYSTATUS_FROMCONSTITUENCYSTATUSCODE

Returns the educational history status constituency status from a given educational history status code.

Return

Return Type
uniqueidentifier

Parameters

Parameter Parameter Type Mode Description
@CONSTITUENCYSTATUSCODE tinyint IN

Definition

Copy


            create function dbo.UFN_EDUCATIONALHISTORYSTATUS_FROMCONSTITUENCYSTATUSCODE
            (
                @CONSTITUENCYSTATUSCODE tinyint
            )
            returns uniqueidentifier
            with execute as caller
            as begin
                declare @RETVAL uniqueidentifier;

                -- Unknown

                if (@CONSTITUENCYSTATUSCODE = 0)
                    set @RETVAL = '00000000-0000-0000-0000-000000000001';

                -- Currently attending

                if (@CONSTITUENCYSTATUSCODE = 1)
                    set @RETVAL = '00000000-0000-0000-0000-000000000002';

                -- Incomplete

                if (@CONSTITUENCYSTATUSCODE = 2)
                    set @RETVAL = '00000000-0000-0000-0000-000000000003';

                -- Graduated

                if (@CONSTITUENCYSTATUSCODE = 3)
                    set @RETVAL = '00000000-0000-0000-0000-000000000004';

                return @RETVAL;
            end