Calculating percentages

  • Thread starter red skelton via AccessMonster.com
  • Start date
R

red skelton via AccessMonster.com

Hi,
I'm having a problem that I was hoping someone might be able to help me out.
I thought it would be straight forward, but what I'm trying to do is this. I
have two seperate queries, and want the total from query "A" divide by total
from Query "B" and display the results in percentage. I have tried
everything I could think of but no luck. Thanks in advace for any help or
suggestions.
VR,
Red
 
J

Jeff Boyce

Red

(love the clown skit...)

You didn't mention where you are trying to do this. If you happen to be
working in a form or a report, could you bring in the results of each query
and add a new control that does the division?

And since we don't have a clue about your underlying data/structure, it will
be tough to see if there's another way to pull what you're after...
 
R

red skelton via AccessMonster.com

Thanks Jeff, (Wish it was me doing the clown skit sometimes LOL)
What I wanted to do was do the division via a seperate query. If I have
query "a" total = 20people and query "b" total = 100people then create a
seperate query "c" used to divide the two totals to come up with a % and use
this % in a text box on a report. Hope this makes sense.
Thanks
Red

Jeff said:
Red

(love the clown skit...)

You didn't mention where you are trying to do this. If you happen to be
working in a form or a report, could you bring in the results of each query
and add a new control that does the division?

And since we don't have a clue about your underlying data/structure, it will
be tough to see if there's another way to pull what you're after...
Hi,
I'm having a problem that I was hoping someone might be able to help me out.
[quoted text clipped - 5 lines]
 
J

Jeff Boyce

Red

Not sure I understand your data yet. Are you saying that you have one
table, and two "samples" (a query of 20 and a query of 100)?

Is there any way these two samples (queries) are related to each other in
your data? For example, all did something on the same day, so you could use
the date to pull them together into one query?

If you are using a report, a "brute force" method might be to use the
results of one query in a "main report", and the results of the second query
in a sub-report. Then you could add a control to your report and set the
ControlSource to something like:
=[FirstQuery'sValue]/[SecondQuery'sValue]

Watch out for /0 issues!

--
Regards

Jeff Boyce
<Office/Access MVP>

red skelton via AccessMonster.com said:
Thanks Jeff, (Wish it was me doing the clown skit sometimes LOL)
What I wanted to do was do the division via a seperate query. If I have
query "a" total = 20people and query "b" total = 100people then create a
seperate query "c" used to divide the two totals to come up with a % and use
this % in a text box on a report. Hope this makes sense.
Thanks
Red

Jeff said:
Red

(love the clown skit...)

You didn't mention where you are trying to do this. If you happen to be
working in a form or a report, could you bring in the results of each query
and add a new control that does the division?

And since we don't have a clue about your underlying data/structure, it will
be tough to see if there's another way to pull what you're after...
Hi,
I'm having a problem that I was hoping someone might be able to help me
out.
[quoted text clipped - 5 lines]
 
R

red skelton via AccessMonster.com

Jeff, thanks for your advice. I've got to go now and wont be back til Mon.
I'll work on it again then. Dont want you to think I've ignored you cuz its
much appreciated. Have a good week end.
Red



Jeff said:
Red

Not sure I understand your data yet. Are you saying that you have one
table, and two "samples" (a query of 20 and a query of 100)?

Is there any way these two samples (queries) are related to each other in
your data? For example, all did something on the same day, so you could use
the date to pull them together into one query?

If you are using a report, a "brute force" method might be to use the
results of one query in a "main report", and the results of the second query
in a sub-report. Then you could add a control to your report and set the
ControlSource to something like:
=[FirstQuery'sValue]/[SecondQuery'sValue]

Watch out for /0 issues!
Thanks Jeff, (Wish it was me doing the clown skit sometimes LOL)
What I wanted to do was do the division via a seperate query. If I have
[quoted text clipped - 20 lines]
 

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