If Statement

L

lucky1

I am trying to run a query, but don't know how to go about it.

If "Disposition" equals "Rejected", sum the "Lot Quantity" of the "Rejected"
records.

If "Disposition" does NOT equal "Rejected", sum the "Lot Quantity" of the
"Rejected" AND "Accepted" records.

Would somebody please help me out?

Thanks.
 
J

Jeff Boyce

It all starts with the data...

?!what data?!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
L

lucky1

I am trying to come up with a Reject Rate for my Final Product Inspection
Report.
In my table I have:

"Disposition" which is "Accepted" or "Rejected"
"Lot Quantity" which is the number of parts in the box that were inspected

I'm needing to divide "Rejected" "Lot Quantity" by the total "Lot Quantity"
to come up with the percentage rejected.



Jeff said:
It all starts with the data...

?!what data?!

Regards

Jeff Boyce
Microsoft Office/Access MVP
I am trying to run a query, but don't know how to go about it.
[quoted text clipped - 8 lines]
 
J

John Spencer

The expression you are looking for is probably something like

SUM(IIF([Disposition] = "Rejected",[Lot Quantity],Null)) / SUM([Lot
Quantity])

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

lucky1 said:
I am trying to come up with a Reject Rate for my Final Product Inspection
Report.
In my table I have:

"Disposition" which is "Accepted" or "Rejected"
"Lot Quantity" which is the number of parts in the box that were inspected

I'm needing to divide "Rejected" "Lot Quantity" by the total "Lot
Quantity"
to come up with the percentage rejected.



Jeff said:
It all starts with the data...

?!what data?!

Regards

Jeff Boyce
Microsoft Office/Access MVP
I am trying to run a query, but don't know how to go about it.
[quoted text clipped - 8 lines]
 
L

lucky1 via AccessMonster.com

Thank you so much!

John said:
The expression you are looking for is probably something like

SUM(IIF([Disposition] = "Rejected",[Lot Quantity],Null)) / SUM([Lot
Quantity])
I am trying to come up with a Reject Rate for my Final Product Inspection
Report.
[quoted text clipped - 21 lines]
 
Top