Placing a parameter on a calculated field?

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

Guest

The calculated field in my query is DateDiff("d",Date(),[ExpirationDate]) and
the parameter on this field (entered in the criteria section) is Between
[Low Value] and [High Value]. The results are incorrect when I run the query
yet when I replace low and high values with actual numbers, the query works.
What am I doing that is causing this problem?
 
I'm just guessing, but it may be that Access is misinterpreting the data
type of the parameters. If so, to resolve this, go to Query Design View. On
the menu bar go to Query, Parameters. Enter the following:

Parameter Data Type
[Low Value] Integer
[High Value] Integer

Use Long Integer instead of Integer if your numbers are going to exceed the
limit (32,767) of the Integer data type.
 
THANK YOU so much Mr. Morgan. My query now works. Again, thank you so much.

Have a nice day.

Wayne Morgan said:
I'm just guessing, but it may be that Access is misinterpreting the data
type of the parameters. If so, to resolve this, go to Query Design View. On
the menu bar go to Query, Parameters. Enter the following:

Parameter Data Type
[Low Value] Integer
[High Value] Integer

Use Long Integer instead of Integer if your numbers are going to exceed the
limit (32,767) of the Integer data type.

--
Wayne Morgan
MS Access MVP


LWarren0202 said:
The calculated field in my query is DateDiff("d",Date(),[ExpirationDate])
and
the parameter on this field (entered in the criteria section) is Between
[Low Value] and [High Value]. The results are incorrect when I run the
query
yet when I replace low and high values with actual numbers, the query
works.
What am I doing that is causing this problem?
 

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

Back
Top