How to display query criteria in my Report?

  • Thread starter Mikael Lindqvist
  • Start date
M

Mikael Lindqvist

Hi,

I have searched but found no answers, so I guess this is standard :p

Anyhow, how do I get a certain fields query criteria written in the report?

(For example, my data source is a query that selects all customers (cust_id)
with annual turnover gretater than 10,000 (criteria is >10000).

Now, sometimes I change the criteria so it would be nice to have it
dynamically turn up on the report (rather than static text). But what's the
"call function" for this?

Kindly,
Mikael
 
M

Marshall Barton

Mikael said:
I have searched but found no answers, so I guess this is standard :p

Anyhow, how do I get a certain fields query criteria written in the report?

(For example, my data source is a query that selects all customers (cust_id)
with annual turnover gretater than 10,000 (criteria is >10000).

Now, sometimes I change the criteria so it would be nice to have it
dynamically turn up on the report (rather than static text). But what's the
"call function" for this?


That can not be done short of retrieving the query's SQL
and parsing out the criteria. I suppose you could add a
calculated field to the query whit the value of the field
the same as the criteria, but this would be more
objectionable than your hokey method of specifying the
criteria.

The usual quick and dirty approach is to use a query
parameter prompt to specify the criteria. E.g.

criteria >[Enter Minimum Turnover]

In this case the report can display the criteria value by
using a text box bound to [Enter Minimum Turnover]

The standard way to deal with query parameters is to use a
form with a text/combo box for users to enter/select the
criteria value. In this case the query criteria would be:

criteria >Forms!yourform.thetextbox

and the report text box would use the expression:
=Forms!yourform.thetextbox
 
E

Eyal

My problem is as followes .
In my criteria i used the Between/And option to enter dates. in my seconed
criteria i entered a seconed Between/and option to enter diffrent style
numbers.
I would like to show both results of both criteria on my report. how can i
do this.
Marshall Barton said:
Mikael said:
I have searched but found no answers, so I guess this is standard :p

Anyhow, how do I get a certain fields query criteria written in the report?

(For example, my data source is a query that selects all customers (cust_id)
with annual turnover gretater than 10,000 (criteria is >10000).

Now, sometimes I change the criteria so it would be nice to have it
dynamically turn up on the report (rather than static text). But what's the
"call function" for this?


That can not be done short of retrieving the query's SQL
and parsing out the criteria. I suppose you could add a
calculated field to the query whit the value of the field
the same as the criteria, but this would be more
objectionable than your hokey method of specifying the
criteria.

The usual quick and dirty approach is to use a query
parameter prompt to specify the criteria. E.g.

criteria >[Enter Minimum Turnover]

In this case the report can display the criteria value by
using a text box bound to [Enter Minimum Turnover]

The standard way to deal with query parameters is to use a
form with a text/combo box for users to enter/select the
criteria value. In this case the query criteria would be:

criteria >Forms!yourform.thetextbox

and the report text box would use the expression:
=Forms!yourform.thetextbox
 

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