Query Criteria

G

Guest

I have multiple fields that I need to evaluate
data. Not sure how to design the query.

I have the following fields
"StartDate" (type DATE)
"EndDate" (type DATE)
"Sunday" (type Check Box)
"Monday" (type Check Box)
"Tuesday" (type Check Box)
etc.
I'm not sure how to do this, I would like
to be able to run 2 queries that do the following:
1. runs a report that only shows data that
falls in-between the "StartDate" and "EndDate"
HOWEVER, only shows data from Today +7 days.
The Second Query
2: If today is a Thursday, then it only shows
data that a: is between the "StartDate"and"EndDate"
b: Todays (Thursdays) date has to be within that range
c: The "check Boxes" come into play here somewhere i know

I am VERY new at this, please be patient.
Thanks
Tom
 
G

Guest

Some clarification is needed, see below:

Tom said:
I have multiple fields that I need to evaluate
data. Not sure how to design the query.

I have the following fields
"StartDate" (type DATE)
"EndDate" (type DATE)
"Sunday" (type Check Box)
"Monday" (type Check Box)
"Tuesday" (type Check Box)
etc.
I'm not sure how to do this, I would like
to be able to run 2 queries that do the following:
1. runs a report that only shows data that
falls in-between the "StartDate" and "EndDate"
HOWEVER, only shows data from Today +7 days.

What if Today is not between startdate and enddate?
What if Today is = enddate? do you want just the enddate or Today + 7 even
though 2 - 7 are after end date?
What if Today is one day before startdate? do you show nothing or days 2 - 7?

The Second Query
2: If today is a Thursday, then it only shows
data that a: is between the "StartDate"and"EndDate"
b: Todays (Thursdays) date has to be within that range
c: The "check Boxes" come into play here somewhere i know
What if it is Tuesay or Friday? Or, are you saying that if only the Thursday
check box is checked, then show only Thursdays within the date range and if
Monday and Wednesdays are the only days checked, we show monday and
wednesdays within the range and no other days?
 
G

Guest

Klatuu said:
Some clarification is needed, see below:



What if Today is not between startdate and enddate? (answer) show nothing
What if Today is = enddate? do you want just the enddate or Today + 7 even
though 2 - 7 are after end date? (answer) just the enddate
What if Today is one day before startdate? do you show nothing or days 2 - 7?
(answer) show nothing

What if it is Tuesay or Friday? Or, are you saying that if only the Thursday
check box is checked, then show only Thursdays within the date range and if
Monday and Wednesdays are the only days checked, we show monday and
wednesdays within the range and no other days? (answer) the latter
Example for both queries:
(answer) example: StartDate 06/15/2006
EndDate 06/29/2006
check boxes are checked for "mon", "wed", "fri"
Query1 result for today+7days
06/16 Friday, 06/19 Monday, 06/21 Wednesday

Query2 result for ONLY today Thursday 06/15/2006
none - thursday is not checked
 
G

Guest

For your date criteria it would be something like

BETWEEN IIf(Date > StartDate, Date) AND EndDate

For each day in the week you will need a column and for the Criteria for
each column something like

IIf([Forms]![MyFormName]![chkMonday], [MondayField],"")

Not sure the syntax is correct, but that is the basic idea. You will, of
course, have to use your own names.
 

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

Top