Rayne
asked on
TSQL Date?
Hello All,
Is there some code or some existing data somewhere that i can use to create/dump into a new date table in SQLServer that has all the regular dates along with a column called "holiday" that says if that date is a holiday or not?
Thank you
Is there some code or some existing data somewhere that i can use to create/dump into a new date table in SQLServer that has all the regular dates along with a column called "holiday" that says if that date is a holiday or not?
Thank you
You can use one insert statements like
insert into holi_tab values (convert(datetime,'20140101',112))
...
insert into holi_tab values (convert(datetime,'20141225',112))
as the holidays are different for different country/area
Please see the holidays below
http://www.timeanddate.com/calendar/?country=1
for USA.
And you can directly detect if the day is Sat or Sun, to know if it is holiday.
http://www.timeanddate.com/calendar/?country=1
for USA.
And you can directly detect if the day is Sat or Sun, to know if it is holiday.
ASKER
I need the federal US holiday from 2013 to 2020....so the fastest way to get them....just viewing will not help
You can just prepare the relevant insert lines for all the years you need. Thanks
ASKER
Basically what you are suggesting is copy paste all that picture into excel and keep doing it for all the years....there gotta be a better way - a list of dates in a data table or something than this visual really..
The point is you should keep such holiday table up to date, for all years. Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER