Link to home
Start Free TrialLog in
Avatar of terpsichore
terpsichore

asked on

Date range overlap - number of days

Dear experts -
There must be a function out there somewhere, but I can't find it -
I have two date ranges - with a start and an end date to each.
I would like to calculate the number of calendar days OVERLAP between the two ranges.
any ideas?
Thanks!
SOLUTION
Avatar of IrogSinta
IrogSinta
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
ASKER CERTIFIED SOLUTION
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
Avatar of terpsichore
terpsichore

ASKER

wow - both eloquent and insightful. this will help me get there.
BTW,  using the function will allow to insert some remarks and allow anyone who looks at the code six months or a year from now to figure out exactly what you were trying to do.  Not so easy when you glom it all into a single DateDiff() function.

On the other hand, if your are using this in VBA rather than a query, you could simply document the code either way.