Link to home
Start Free TrialLog in
Avatar of RalphyC
RalphyC

asked on

How to get the difference between two dates ,excluding weekends in MS ACCESS query

How to I obtain difference between two dates ,excluding weekends in MS ACCESS query.
Avatar of BrandonGalderisi
BrandonGalderisi
Flag of United States of America image

Try this.

select datediff("day", date1,date2)-(datediff("week",date1,date2)*2)
from SomeTable
Avatar of RalphyC
RalphyC

ASKER

Is there any way to exclude HOLIDAYS?
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You would need to have a list of holidays in a table.  but if you want holidays excluded, I'd suggest a new question.  The original question was asked, and I believe answered, by me.
Avatar of RalphyC

ASKER

So far so good, but when executing the above Function, I received, Complie Error, Varable Not Defined in the following line;

If IsMissing(Holidays) Then' it appears Holidays variable is not defined
RalphyC,

I was glad to have helped.  That said, I think that in this case a split was warranted: Brandon did answer the
original question, and my suggestion was really only needed to address the followup on excluding holidays
as well.

I suggest that you use the 'request attention' link to ask the Mods to reopen the question so that you may
reenter it as a split.

Regards,

Patrick
Thank you Patrick.  I would have to agree with you on this case.

Brandon
RalphyC,
   On your request, we could have this question re-opened if you feel that matthewspatrick and myself have a valid point.

Brandon