/*
--
Execution
select
dbo.getPeriodID( '1/31/2012' );
select
dbo.getPeriodID( cast('1/31/2012' as date) );
*/
ALTER function [dbo].[getPeriodID](
@PeriodDate date
)
returns int
as
begin
return(
( year( @PeriodDate ) * 100 )
+ month( @PeriodDate )
);
end
;
No comments:
Post a Comment