Re: Date range overlap
anonymous_at_discussions.microsoft.com
Date: 09/18/04
- Next message: Allen Browne: "Re: Date range overlap"
- Previous message: Squirrel: "Re: Emailing completed form and shortcut question"
- In reply to: Allen Browne: "Re: Date range overlap"
- Next in thread: Allen Browne: "Re: Date range overlap"
- Reply: Allen Browne: "Re: Date range overlap"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 18 Sep 2004 01:19:07 -0700
Hello Allen
Thank you for your pointer to your web page and your
article. This will provide excellent support for my
project. I have a question I hope you can answer! I
intended to provide the date range I am comparing the
tables records with via two calendar controls on an
unbound form. I could write a temporary record to the
table to provide the query with the data then delete this
after I have my information (This works) but it seems a
little messy. Is it possible to compare external date
ranges using an unbound form control? I have also removed
the second record in the query's results by placing a "Not
Is Null" parameter in the [event_1].[locationid]. This
again appears to work, but will it have any bearing on the
way the query works.
Once again thanks for your support
Jenny
>-----Original Message-----
>There are 2 parts to your question:
>1. Does it overlap?
>2. Is the overlap a weekday?
>
>Two events overlap if both:
>- A starts before B ends, and
>- B starts before A ends.
>You can create a query that identifies all the overlaps
by using those
>criteria. Detailed example (including handling Null
dates) in article:
> Clashing Events/Appointments
>at:
> http://members.iinet.net.au/~allenbrowne/appevent.html
>
>Once you have that query returning all the records that
have overlapping
>dates, you then need to discover whether any of those
overlapping days are
>Monday-Friday. That means you need to convert the ranges
to records to you
>can examine each day. You can either loop through them
all in code, and loop
>through the days in each range, examining the Weekday()
of each one.
>Alternatively, you can create a table of holidays and
weekends, and use
>another cartesian product between this table and the
query above, limiting
>the dates to each range.
>
>--
>Allen Browne - Microsoft MVP. Perth, Western Australia.
>Tips for Access users - http://allenbrowne.com/tips.html
>Reply to group, rather than allenbrowne at mvps dot org.
>
>"jenny" <anonymous@discussions.microsoft.com> wrote in
message
>news:0f4101c49d11$4a5c14d0$a501280a@phx.gbl...
>>I need to know if a date range overlaps another date
range
>> if the datepart is a weekday for example:
>>
>> Date range 1 = 16/08/2004 to 22/08/2004
>>
>> Date Range 2 = 20/08/2004 to 21/08/2004 = true
>> Date Range 2 = 12/08/2004 to 12/08/2004 = false
>> Date Range 2 = 21/08/2004 to 22/08/2004 = false
>> Date Range 2 = 20/08/2004 to 22/08/2004 = true
>> Date Range 2 = 12/08/2004 to 16/08/2004 = true
>>
>> If anyone knows a quick way to evaluate the answer. I
>> would appreciate your help.
>>
>> Thanks Jenny
>
>
>.
>
- Next message: Allen Browne: "Re: Date range overlap"
- Previous message: Squirrel: "Re: Emailing completed form and shortcut question"
- In reply to: Allen Browne: "Re: Date range overlap"
- Next in thread: Allen Browne: "Re: Date range overlap"
- Reply: Allen Browne: "Re: Date range overlap"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|