How to calculate percentage based on three tables?

A

awu

Hi,

I have two tables, called "tblStyles" and "tblComponents". They are
one-to-many relationship. One style number can have many components.
So I have another table called "tblDetails".

tblStyles has following fields:
styleID
productline
stylenumber
One productline includes many stylenumbers in this table. I didn't
separate productline and style number into two tables. The original
information in Excels comes this way. So the table looks like:
styleID1 Productline1 stylenumber1
styleID2 Prodcutline1 stylenumber2
styleID3 productline1 stylenumber3
styleID4 productline1 stylenumber4
styleID5 productline2 stylenumber5
styleID6 Productline2 stylenumber6
styleID7 Prodcutline2 stylenumber7
styleID8 productline2 stylenumber8
styleID9 productline2 stylenumber9
styleID10 productline2 stylenumber10
etc.

tblComponents has following fields:
componentID
components
status (This is a list box. It has three status, s1, s2, s3)
This table looks like:
componentID1 component1 status1
componentID2 component2 status1
componentID3 component3 status3
componentID4 component4 status2
componentID5 component5 status2


tblDetails has following fields:
componentID
styleID

My question is:
I use one form to show style number list under one productline. In
this form, I need show the percentage = (number of components with
status s1 under one style number and one productline) / (number of
tatal components under this style number and this production line)

I have one query for these three tables. I try to use "DCount"
function, but no success. I must need help.

Thank you
awu
 

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