Query with 2 conditions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In this query I want the user to enter a start date and an end date and also
enter
a beginning temperature and an ending temperature.
So basically the report will show a range of temperatures between the given
dates.
The criteria for the date field (between [Enter Start Date] and [Enter End
Date]
The criteria for the temperature field (between [Enter Starting Temp] and
[Enter Ending Temp.]

Am I missing something? It works some of the time but it doesn't seem to be
accurate. It seems to be leaving out some of the temps within that range.
Appreciate all your help.
 
Nope. Looks correct.

You do want an AND condition right? In other words the records must fall
between your temperatures AND within the dates, correct? If not, if you
want an OR, then you need to place the criteria on two separate rows in your
criteria area.
 
Thanks for the reply Rick. I must be doing something wrong. Yes! I do want
the "And" Condition. If my start date is "02/02/05" and my end date is
06/06/05 and my beginning temp is 3 and ending is 20, I want the query to
give me the
temps between 3 and 20 between the dates 02/02 to 06/06. My query is giving
me numbers outside of the temp range. If I delete the temp criteria and just
use date criteria and chose different dates, that works perfect for the date
range. Does it matter what type of query I should be using for a Parameter
query? (ie simple, crosstab) Thanks again.

Rick B said:
Nope. Looks correct.

You do want an AND condition right? In other words the records must fall
between your temperatures AND within the dates, correct? If not, if you
want an OR, then you need to place the criteria on two separate rows in your
criteria area.

--
Rick B



TBoe said:
In this query I want the user to enter a start date and an end date and also
enter
a beginning temperature and an ending temperature.
So basically the report will show a range of temperatures between the given
dates.
The criteria for the date field (between [Enter Start Date] and [Enter End
Date]
The criteria for the temperature field (between [Enter Starting Temp] and
[Enter Ending Temp.]

Am I missing something? It works some of the time but it doesn't seem to be
accurate. It seems to be leaving out some of the temps within that range.
Appreciate all your help.
 
Are your temperatures stored in a number field or in a text field? In other
words, could you enter a temperature of "N/A" for not available? If so, then
you have a text field, and you can get numbers that are to the human eye out of range.

Did you try entering the numbers directly into the query (instead of the
parameters)? Did that work or did that fail?

Can you post a few of the values that were out of range and the range you used?

With a crosstab query you MUST declare your parameters and if any other queries
are used in the crosstab their parameters must also be declared. However; if
you used a crosstab query and didn't declare your parameters you would be
getting an error message.

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2
 
Back
Top