Anyone who likes a challenge....(Calculation based on queries)

revmk

New member
Local time
Today, 12:37
Joined
Jun 28, 2006
Messages
6
Hello all,

I've been given a database dump that I am in the process of writing reports for. The data is essentially in an unhelpful format. Basically it lists events for single establishments over 7 years (i.e one client could have 12 record, another could have only 7). This is all in one table.

Basically I have written all my queries to pull data out and into reports, so far so good :o . The important thing here is that the data can not be added to :eek: .

OK, this is where I get stuck. What I need to do is write some form of calculation, based on the results of queries to give me a figure.

The calculation I need will produce value 'D';

‘A’ = Value as per query 1 (in - currency)
'B' = Value as per query 2 (out - currency)
'X' = Value as per query 3 (numeric value)
C = B/X

'D' = the sum of this.....(however I do it)
If value of ‘C’ is greater than ‘A’ by
30% increase the value of A by 20% (effectivly making 'D' = 120% of A)
60% increase the value of A by 50% (effectivly making 'D' = 150% of A)
90% increase the value of A by 80% (effectivly making 'D' = 180% of A)
120% increase the value of A by 110% (effectivly making 'D' = 210% of A)
If greater still then it should do something else (i.e. - display 'error')

Any help would be greatly appreciated :o . I'm not new to Access, but my knowledge of functions etc. is limited. I'm really only good at queries and reports.

Thanks again :D
 
You essentially have the answer already.

Store the value of each query into a variable, use a SELECT..CASE to change the value of A, then do sum all the variables for D.

What's the problem?
 

Users who are viewing this thread

Back
Top Bottom