Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Holidays

Author  Topic 

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2004-12-20 : 10:31:24
I want to set up a SP that skips the holidays, does anybody has any idea or is there any other topic on this same... topic?

Thanks!

I Love Challenges! That's why I love coding!

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-20 : 10:59:10
How do you know what a holiday is?

Often this is done by a function which gets the next day / previous day and skips holidays / weekends.
For queries though you wikll need to join to a holiday table and exclude weekends - maybe beiong country dependent.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-12-20 : 11:01:33
you'll need a table of holiday dates to join on...

EDIT:


Go with the flow & have fun! Else fight the flow
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2004-12-20 : 11:21:00
My company has a list of core holidays and we didn't have nothing set this year, I'm trying to implement something that woould skip the holidays. The table thing looks good, but let me know if you guys come accross with any other method.

Thanks a lot.

I Love Challenges! That's why I love coding!
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-12-20 : 11:32:17
quote:
Originally posted by igorblackbelt

I want to set up a SP that skips the holidays, does anybody has any idea or is there any other topic on this same... topic?




As mentioned,you need a table of these holidays.

what do you mean by "skip" ? you need to define clearly what you are looking for in your stored procedure, what data should be returned and in what format.

- Jeff
Go to Top of Page

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2004-12-20 : 11:39:09
Well, since I work on a production enviroment, and I need to report all the production from yesterday or MTD or Monthly, I need to skip the holliday, like If yesterday was a holiday, give me the day before yesterday worth of data.


I Love Challenges! That's why I love coding!
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-12-20 : 13:01:24
I should blog this

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=31840&SearchTerms=holiday,weekend



Brett

8-)
Go to Top of Page
   

- Advertisement -