[AccessD] calculation

Drew Wutka DWUTKA at Marlow.com
Mon Jul 13 14:29:18 CDT 2009


No, it'll count everything.  So you end up with a list of Grouped by
Patients and field 'B', with a Third Column giving the percentage. 

So with the test data of: (I added a few more rows)

ID	Patient	B
1	AA		1
2	AA		1
3	AA		2
4	AA		3
5	BB		1
6	AA		4
7	BB		2

That query returns:

Patient	B	Percentage
AA		1	40%
AA		2	20%
AA		3	20%
AA		4	20%
BB		1	50%
BB		2	50%

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: Monday, July 13, 2009 12:54 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] calculation

Will that count just the occurrences of test score = 3?

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Monday, July 13, 2009 9:57 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] calculation

This should do what you want:

SELECT T1.Patient, T1.B, (SELECT Count(*) FROM tblPatients WHERE
Patient=T1.Patient AND B=T1.B)/(SELECT Count(*) FROM tblPatients WHERE
Patient=T1.Patient)*100 & "%" AS Percentage FROM tblPatients AS T1 GROUP
BY
T1.Patient, T1.B;

I made your table (with ID, Patient, B as the fields) and called it
tblPatient.

Drew
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Pedro Janssen
Sent: Monday, July 13, 2009 9:45 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] calculation

Hello Dan, and others.

i haven't got an query equation jet,
i can't seem to manage the group by calculation.

How i get 25%

Patient AA has 4  test (ID 1 to 4)
One of these has Value B=3.

calculation: 1 : 4 = 0,25    x 100% = 25%

Pedro



----- Original Message -----
From: "Dan Waters" <dwaters at usinternet.com>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Monday, July 13, 2009 4:19 PM
Subject: Re: [AccessD] calculation


> Pedro,
>
> Can you post your equation?  I can't see how to get 25%.
>
> Also - what is B3?
>
> Dan
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
pedro at plex.nl
> Sent: Monday, July 13, 2009 3:55 PM
> To: accessd at databaseadvisors.com
> Subject: [AccessD] calculation
>
> Hello Group,
>
> i need to calculate the percentage(%) of the value B3 in access for
the
> total of numbers of B.
>
> The table that is have:
>
> ID    patient    B
> 1     AA         1
> 2     AA         1
> 3     AA         2
> 4     AA         3
> 5     BB         1
>
>
> Query:
>
> patient    B(%)
> AA         25
>
> How can i do this?
>
> Thanks
>
> Pedro
>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the
person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI
Business 
Sensitive material. If you are not the intended recipient, please
contact
the sender 
immediately and destroy the material in its entirety, whether electronic
or
hard copy. 
You are notified that any review, retransmission, copying, disclosure,
dissemination, 
or other use of, or taking of any action in reliance upon this
information
by persons 
or entities other than the intended recipient is prohibited.


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI Business 
Sensitive material. If you are not the intended recipient, please contact the sender 
immediately and destroy the material in its entirety, whether electronic or hard copy. 
You are notified that any review, retransmission, copying, disclosure, dissemination, 
or other use of, or taking of any action in reliance upon this information by persons 
or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list