By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,696 Members | 2,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,696 IT Pros & Developers. It's quick & easy.

Query - 2 dates in Appointment Schedule Database

P: n/a
Lea
Having a problem with a query within a table for appointment schedules.

In this table tblMeetingInfo are two fields, StartDate and EndDate.

The date information is entered into each of these fields like:
1/12/2005 (This could represent data entered into either field).

Most appointments are one day in duration. In this example, StartDate
would be equal to Enddate: 1/12/2005 to 1/12/2005 (StartDate to
EndDate).

Some appointments are extended. In this example, StartDate would always
be less than (earlier) than EndDate or, conversely, EndDate would
always be greater (later) than StartDate:
1/8/2005 to 1/16/2005 (StartDate to EndDate).

I need to print a report every week listing all the appointments that
fall within that particular weekly time frame.

Is there a way to utilize a query to compare the StartDate and EndDate
of each record to see if any date is between and including the
StartDate and EndDate would qualify and thus be on the report?

I tried in my last query by entering this criteria in the StartDate:
Between [Type the beginning date:] And [Type the Ending Date:]

Example data

StartDate EndDate
1/12/2005 1/21/2005
1/12/2005 1/12/2005
1/8/2005 1/19/2005

Now I need all appointments that fall between the week of 1/16/2005 and
1/22/2005.

Any help appreciated!

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I asked about the same question in 1999 or 2000, and Albert Kallal gave
me a great answer. You might want to look it up in the archive.

Nov 13 '05 #2

P: n/a
Lea,

Try
([startdate] > beginning date and [strtdate] < ending date) or
[enddate] > beginning date and [enddate] < ending date)
HTH
Sunil Korah

Nov 13 '05 #3

P: n/a
Lea
Looked from 1995 to 2003 and did not find posting. Thanks.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.