Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

30th Business Day

Status
Not open for further replies.

Inertial

Programmer
Jun 25, 2004
2
US
Great site. I'm new so go easy on me.

I need to calculate the 3oth business day from a particular date. The date that I need to calculate from is currently in 20040101 (1/1/04) format. Is there a particular function in msSQL that allows for business day calculations?

Thanks
 
No. Everyones concept of what a business day is is different so there is no built in function.

You will have to decide what a business day is, build structures to support the definition and calcultae using that info.

======================================
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.
 
To get you started look at the DATENAME function, it can tell you the day of the week or if it is a weekday.

Then you will want to create a holiday table with the company approved holidays in it.

Then write a function to determine if the day is a weekday and not a holiday.

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top