Files
budget-database/functions/tvf_GetHolidays.sql
2022-07-15 15:37:20 -04:00

15 lines
327 B
Transact-SQL

use Leo
go
create FUNCTION dbo.tvf_GetHolidays(@year int)
RETURNS TABLE
AS
RETURN (
select dt, dbo.fn_GetHoliday(dt) as Holiday
from (
select dateadd(day, number, convert(varchar,@year) + '-01-01') dt
from master..spt_values
where type='p'
) d
where year(dt) = @year and dbo.fn_GetHoliday(dt) is not null
)