## User Tag List

Thanks:  0
Likes:  0
Dislikes:  0

if i want to select a future date and that date should be business day, how do i get

strDay=Date
now strDay should be a business day.
how do i get that.

2. I think that each company, in each part of the world and within a country will have different business day rules.

Perhaps have a table of non-working days.

Use the logic above. If you hit a non-working day, try the next day.

You can test for days such as weekend days that are known to be non-business days.

Google has sites that show holidays by country, region, state, territory and other determining input.

3. strDay=Date

If isBusiness 1 or 7, then it is a weekend. Otherwise, it would be a business day. (Assuming Saturday and Sunday is the weekend)

4. If Mon thru Friday (2 - 6) happens to be a holiday, is it considered a business day too or do you treat that as a 1 or 7 (Saturday or Sunday)?
How about those businesses that do business on Saturdays and Sundays? (like restaurants or hotels or supermarkets)

5. There are also vague holidays such as Columbus Day in parts of the US. Some companies allow workers to pick any day to celebrate it. Now that I have no idea how to handle in a function.

6. thanks for your solutions, As of now i am treating week days as business days. but need to find a robust solution.

7. What about something like this:

Code:
```strDate=DateAdd("w",5,Date)
Select Case Weekday(strDay)
Case 1, 7
End Select```

Mark Smith

8. Perhaps do a datepart to get the day number and than compare against an array of weekends and holidays, something like this? (Weekends and holidays in January 2014)

strDate="01/31/2014"
y=datepart("y",strDate)
If y < 10 Then
y="0"&y
End If
x = filter(array("01","04","05","11","12","18","19","2 0","25","26"),y)

If ubound(x) = 0 Then
MsgBox "Weekend or Holiday"
Else
msgBox "Weekday"
End If

9. There are two hours(or more) a year that we have not considered.

During daylight savings time or when the time zones are different there will be a window where all of the date functions may give a wrong day.

I am not sure if it worth mentioning.

Thanks,

Kevin

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.