Number of Days formula ...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I am calculating number of days as :

days = end date - start date

how can I remove sundays from that formula?

Like : if it is from Sat. April 15th to Mon. 16th , it wil be one day. And
if it is from Mon. 16th Wed. 18th it will be two days.

What can I do ?

Thank you

Mustafa
 
Hi Mustafa,

I think this will work...Start with the WorkingDays2 function that can be
found on this web page:

http://www.mvps.org/access/datetime/date0006.htm

(Scroll about halfway down the page to see this function). It is designed to
accept two dates and returns the number of weekdays between them. If you want
to count Saturdays, I think you can simply change this line of code:

Change:
If Weekday(StartDate) <> vbSunday And Weekday(StartDate) <> vbSaturday Then

to this:
If Weekday(StartDate) <> vbSunday Then


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
Mustafa,

I saw this question and I do it every day but never thought about doing it
in access. If this helps, the formula in Excel is =networkdays(a2,b2) this
takes out the weekends, you can also calculate just Sundays and holidays
throughout the year.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top