Trouble with parameter query (1 Viewer)

tcaprice

Registered User.
Local time
Today, 00:17
Joined
Mar 28, 2001
Messages
21
I have a query where I calculate the Annual Contribution Amount with the following statement:

Annual$: ([Current DEDUCTION]*52)

With my query, I also want to select only those records that have a calculated amount greater than the amount I will enter in a parameter.

I normally enter a paramater as follows in the criteria line:

Like [Enter Amount:]

However when I'm trying this with this calculated Annual$ field I am getting all records regardless of value. My alternative is to hard-code the value in the criteria ">999" and have to change it each time.

There must be a better way. All help is appreciated.

Thanks.

Tom
 

Jon K

Registered User.
Local time
Today, 00:17
Joined
May 22, 2002
Messages
2,209
Try this Criteria:-
> [Enter Amount:]


In order to return the correct records, you may need to declare the data type of the parameter [Enter Amount:] as follows:-

When still in query Design View, choose menu Query, Parameters...
In the Parameter column, type [Enter Amount:]
In the Data Type column, choose the correct data type
Click OK
 

tcaprice

Registered User.
Local time
Today, 00:17
Joined
Mar 28, 2001
Messages
21
Jon K,

Thank you so much!!! Worked like a charm. Awesome to be able to key in the amount vs. numerous hard-coded queries. I had never worked with the Parameter column/data type setting before.

FYI, to anyone else reading this, I did have to do both things Jon recommended. It did not work until I declared the data type of the parameter.

Thanks again John, you've made my life much easier! :D

Tom
 

Users who are viewing this thread

Top Bottom