Only Business Days with DateDiff function.

1. Member
Join Date
Dec 1969
Posts
58

## Only Business Days with DateDiff function.

hi,<BR><BR>I have two date fields, but I am only interested in finding the difference in business days. I need to ignore Saturdays and Sundays. Can anyone point me in the right direction? Thanks as usual!!

2. Senior Member
Join Date
Dec 1969
Posts
96,118

## Find number of weeks...

...multiply weeks by 5. Adjust for which day of week you are starting and ending on.<BR><BR>Let&#039;s see...<BR><BR>&#060;%<BR>startDate = ...<BR>endDate = ...<BR><BR>swd = WeekDay(startDate)<BR>ewd = weekday(endDate)<BR><BR>s2 = startDate - swd<BR>e2 = endDate - ewd<BR><BR>wks = DateDiff( "w", s2, e2 )<BR>days = wks * 5 + ewd - swd<BR>%&#062;<BR><BR>A quick bit of head-computing says that&#039;s right.<BR><BR>Of course, it doesn&#039;t account for holidays.<BR><BR>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•