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 2005 Forums
 Transact-SQL (2005)
 Next processing date

Author  Topic 

Trudye
Posting Yak Master

169 Posts

Posted - 2008-08-22 : 06:11:55
Does anyone have a date rtn that calcs the next processing date, taking into account holidays? I used to have one written in VB but lost it.

Thanx,
Trudye

RyanRandall
Master Smack Fu Yak Hacker

1074 Posts

Posted - 2008-08-22 : 06:59:18
Perhaps I'm missing something. What's your definition of 'next processing date' and 'holiday'?

Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-22 : 07:31:46
Are you looking for next business day?
Go to Top of Page

Trudye
Posting Yak Master

169 Posts

Posted - 2008-08-22 : 08:35:13
sorry about that, yes that's exactly what I'm looking for Next Business day.
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-08-22 : 09:38:51
[code]declare @start_date datetime
declare @end_date datetime
select @start_date = getdate()+1
select @end_date = @start_date+7

select
NEXT_WEEKDAY_DATE = min(a.[DATE])
from
-- Date Table Function F_TABLE_DATE
-- http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519
dbo.F_TABLE_DATE ( @start_date, @end_date) a
where
a.[DAY_OF_WEEK] between 2 and 6 and
a.[DATE] not in ( Select b.Holiday from MyHolidayTable a )[/code]

CODO ERGO SUM
Go to Top of Page

Trudye
Posting Yak Master

169 Posts

Posted - 2008-08-22 : 11:34:32
Thank you so very much Michael.

Go to Top of Page

Trudye
Posting Yak Master

169 Posts

Posted - 2008-08-22 : 21:47:59
I have a not to bright question, what does this statement mean, what does the N mean?

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-08-22 : 22:27:06
quote:
Originally posted by Trudye

I have a not to bright question, what does this statement mean, what does the N mean?




What statement ? What N ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-23 : 06:32:26
quote:
Originally posted by Trudye

I have a not to bright question, what does this statement mean, what does the N mean?




http://support.microsoft.com/kb/239530

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -