×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# how to calculate a future date

## how to calculate a future date

(OP)
Good Morning

I have been trying to find a way to calculate a future date based upon an already existing date
being passed into a routine

My question is this

I have a date, for example 05/25/16 and I need to add 48 months plus 10 days to create this future date
basically for 10 business days, not a full days tens

I also have to check for holiday's after the future has been created

I can do this in Visual Foxpro, but where I am they are going to .net and this would be a great subroutine
for future processing

So if anyone can point me in the right direction on this greatly appreciated

### RE: how to calculate a future date

Dim CurrentDate AsDate

Dim NewDate As Date

Select Case NewDate.DayOfWeek
Case DayOfWeek.Saturday
NewDate = DateAdd(DateInterval.Day, 13, NewDate) 'Add 13 days: 1 to get to Sunday, 5 for the first week, 2 for the weekend, 5 more for the next week (10 business days)
Case DayOfWeek.Sunday
NewDate = DateAdd(DateInterval.Day, 12, NewDate) 'Add 12 days: 5 for the first week, 2 for the weekend, 5 more for the next week
Case Else

End Select

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!

### RE: how to calculate a future date

What you really need is a business-day calendar table. Every manufacturing company I've worked for has had a manufacturing-day calendar, that you can join to your table(s) and simply add to the business-days to arrive at a valid work day. No guessing for holidays or other non-work days.

Skip,

Just traded in my OLD subtlety...
for a NUance!

### RE: how to calculate a future date

(OP)
thank you for the info

greatly appreciated

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!