mirror of
https://github.com/acedanger/budget-database.git
synced 2025-12-06 07:00:14 -08:00
moving to postgres
This commit is contained in:
15
mysql/functions/tvf_GetHolidays.sql
Normal file
15
mysql/functions/tvf_GetHolidays.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
)
|
||||
Reference in New Issue
Block a user