General discussion

Locked

MS Access--Weekend function?

By Dcrish ·
Is there a MS Access formula that allows me to skip weekend days?

I am creating an Employee Leave table in Access. Some of the fields are StartDate and EndDate. I would like a third field called TotalDaysOut that would calculate how many days the employee was out, but exclude Saturdays and Sundays.

I will check back frequently for answers. Please let me know if you need more info.

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

MS Access--Weekend function?

by mbarker734 In reply to MS Access--Weekend functi ...

The below function will work for you PROVIDED the dates entered are only weekdays Monday thru Friday. Inputing a start or end date that is either a Saturday or Sunday will produce undesired results.

((DateDiff("d",[Start_Date],[End_date]))-((Int((DateDiff("d",[Start_Date],[End_date])/7)+0.5))*2))

Hope this helped some,

Mark

Collapse -

MS Access--Weekend function?

by mbarker734 In reply to MS Access--Weekend functi ...

If you have the dates submitted to you as:

First weekday date you will be off:

Weekday date you will return:

The above works.

Good luck,

Mark

Collapse -

MS Access--Weekend function?

by Dcrish In reply to MS Access--Weekend functi ...

Poster rated this answer

Collapse -

MS Access--Weekend function?

by ldassow In reply to MS Access--Weekend functi ...

This function is included in the Analysis ToolPak add-in macro. This can be obtained off of your office cd or from the microsoft website. The macro you will be working with is called NETWORKDAYS or you can use the macro called WORKDAY. I hope this helps.

Collapse -

MS Access--Weekend function?

by Dcrish In reply to MS Access--Weekend functi ...

Poster rated this answer

Collapse -

MS Access--Weekend function?

by Dcrish In reply to MS Access--Weekend functi ...

This question was closed by the author

Back to Software Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums