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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add 30 Business Days as a due date to the orig date

Status
Not open for further replies.

bhulku

MIS
Jun 12, 2006
3
US
Hi,

I am trying to add 30 working days as an due date to an original date when the report was submitted. I reviewed the code provided in the FAQ but I am not sure of how to add 30 working days to an original date.

Can someone please guide me on how to get started.

Thanks
 
You need to define a woring day - Monday to Friday? Monday to Saturday? Does it include holiday days? Do you have a list of Holiday days?

You can then use a loop to move on - in pseudo code

function Add30Days (inputDate) as date

dim currdate as date

currdate=inputdate
x=0

do while x<30
check to see if currdate is a working day and NOT a holiday IF it is, add 1 to X else do not add to x
currdate=currdate+1
loop
add30days=currdate
end function

You will need some sort of list of holiday days for your region. You can use datepart to test for the day of week any particular date is.

SeeThru
Synergy Connections Ltd - Telemarketing Services

 
There are at least two faq articles on the subject, with source code here (in Tek-Tips). probable key words Business days or workdays



MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top