reduce queries by using code

A

anil

hi all
I have around 30 queries for one particular report due to each
parameter having different formula and format.I will try to explain and
needs advice and help if it will be better to convert it into code and
in which way.

first is parameterized query which is based on many tables and gets
'Date' from the form and other filters such as type = 'R' and model.
In next query it filters for required 9 parameters and formats as per
in full format(thm in trihalomethanes).

then I have to get 3 queries for EACH parameter as requires total
Results,Number of pass results ,Number of fail results.% results passed
- for each monthly and yearly results .

Some queries are also using the few functions e.g. 95% percentile
,stddev , which is written in code.
In yearly results I need the results for last 1 year and also calculate
total Results,Number of pass results ,Number of fail results.% results
passed.

Then the another problem is each parameter has to be expressed in
different decimal place format as parameter 1& 4 in 3 decimal
places,parameter 2 in 1 decimal places and remaining in 2 decimal
places.

I have made union query in last to combine all the parameters fro
monthly and yearly results.

In VBA I have done DAO code to get parameterized query as recordset and
then filter it.But i don't know how to get each recordset for
particular formula for each parameter and decimal places like the query
for group by and max,min or count.
e.g " select A,B,---Count(R)max(X),format(min(Z),"0.00") from query P ;

Since some of these queries also become the base for other queries
like general board results etc,so I am in doubt of moving towards code
but 30 queries are driving me crazy.

I hope I have explained properly
thanks
anil
 
A

anil

Thanks for your help
Atleast you solved my one problem and it helped in other module.

Now to old problem see I have one query built on other,say in first
query I filter for 9 parameters from 95 parameters and

then calculate min,max,mean(95% in some parameter and function in some
parameter) for each seperate parameter - monthly and yearly as well.

Then i combine Both monthly and yearly query as
Name,date,Mmin,Mmax,Mmean,Ymean for each parameter.
Then i have used union query to combine all parameters(which I can
reduce by use of ur functions).

What I was mainly concerned is that if i get first query as recordset
in VBAcode then I am not able to use the query on it so as to filter
for each parameter and then combine all of them

can I do it anyhow
thanks
anil
 

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