iif question

G

Guest

I have a field called Evaluation Result, that is either "pass" or "fail" in a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
J

John Spencer

You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

Guest

I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


John Spencer said:
You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

smeldawg said:
I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
G

Guest

Try this ---
Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Count([Evaluation
Result]),"Percent")

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


John Spencer said:
You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

smeldawg said:
I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
J

John Spencer

Missed a closing bracket for one thing

Format(Abs(Sum([Evaluation Result] = "Pass"))/
Count([Evaluation Result]),"percent")

Also, I'm not sure why you have First in that expression.

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

Guest

I tried this one and I got this error message:

Extra ) in query expression 'First([Format(Sum(IIf([Evaluation
Result]="Pass",1,0))/Count([Evaluation Result]),"Percent")])'


--
Drock-13


KARL DEWEY said:
Try this ---
Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Count([Evaluation
Result]),"Percent")

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


John Spencer said:
You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
G

Guest

John,

I tried yours and this is the error message I got:

Extra ) in query expression 'First([Format(Abs(Sum([Evaluation
Result]="Pass"))/Count([Evaluation Result]),"Percent")])'

I am adding the expression exactly as you have sent it. the error message is
adding the 'First and the extra ])'.
--
Drock-13


John Spencer said:
Missed a closing bracket for one thing

Format(Abs(Sum([Evaluation Result] = "Pass"))/
Count([Evaluation Result]),"percent")

Also, I'm not sure why you have First in that expression.

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

I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.
 
J

John Spencer

Try the following.
First(Format(Abs(Sum([Evaluation Result]="Pass"))/Count([Evaluation
Result]),"Percent"))

Square brackets are used to delimit Object names and field and table names
in a query.

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

smeldawg said:
John,

I tried yours and this is the error message I got:

Extra ) in query expression 'First([Format(Abs(Sum([Evaluation
Result]="Pass"))/Count([Evaluation Result]),"Percent")])'

I am adding the expression exactly as you have sent it. the error message
is
adding the 'First and the extra ])'.
--
Drock-13


John Spencer said:
Missed a closing bracket for one thing

Format(Abs(Sum([Evaluation Result] = "Pass"))/
Count([Evaluation Result]),"percent")

Also, I'm not sure why you have First in that expression.

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

I tried this and here is the error message I got:

Syntax error (comma) in query expression
'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.
 
G

Guest

That is not what I posted. Where are you getting the 'First' from?
--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this one and I got this error message:

Extra ) in query expression 'First([Format(Sum(IIf([Evaluation
Result]="Pass",1,0))/Count([Evaluation Result]),"Percent")])'


--
Drock-13


KARL DEWEY said:
Try this ---
Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Count([Evaluation
Result]),"Percent")

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


:

You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
G

Guest

I tried this one and this is the error message I received:

Extra ) in query expression 'First([Format(Sum(IIf([Evaluation
Result]="Pass",1,0))/Count([Evaluation Result]0,"Percent"])'.
--
Drock-13


KARL DEWEY said:
Try this ---
Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Count([Evaluation
Result]),"Percent")

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


John Spencer said:
You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
G

Guest

All you have to do is count the number of left parenthesis and the number of
right parenthesis and they must match.
What is this supposed to do ---
Count([Evaluation Result]0,"Percent"] ....?

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this one and this is the error message I received:

Extra ) in query expression 'First([Format(Sum(IIf([Evaluation
Result]="Pass",1,0))/Count([Evaluation Result]0,"Percent"])'.
--
Drock-13


KARL DEWEY said:
Try this ---
Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Count([Evaluation
Result]),"Percent")

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


:

You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
G

Guest

I have been trying all kinds of suggestions and by now I am really not sure
what is going on with this expression. Here is what i am trying to get. I
need to sum up a column on a report. This column is called Evaluation Result.
This column has either pass or fail in it. I want to sum up the column with %
representing the percent passed.

I am lost and would appreciate any help.

Thanks
--
Drock-13


KARL DEWEY said:
All you have to do is count the number of left parenthesis and the number of
right parenthesis and they must match.
What is this supposed to do ---
Count([Evaluation Result]0,"Percent"] ....?

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this one and this is the error message I received:

Extra ) in query expression 'First([Format(Sum(IIf([Evaluation
Result]="Pass",1,0))/Count([Evaluation Result]0,"Percent"])'.
--
Drock-13


KARL DEWEY said:
Try this ---
Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Count([Evaluation
Result]),"Percent")

--
KARL DEWEY
Build a little - Test a little


:

I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


:

You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
G

Guest

Use this in a footer of the report ---
= Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Sum(IIf([Evaluation
Result] Like "*",1,0)),"Percent")

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I have been trying all kinds of suggestions and by now I am really not sure
what is going on with this expression. Here is what i am trying to get. I
need to sum up a column on a report. This column is called Evaluation Result.
This column has either pass or fail in it. I want to sum up the column with %
representing the percent passed.

I am lost and would appreciate any help.

Thanks
--
Drock-13


KARL DEWEY said:
All you have to do is count the number of left parenthesis and the number of
right parenthesis and they must match.
What is this supposed to do ---
Count([Evaluation Result]0,"Percent"] ....?

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I tried this one and this is the error message I received:

Extra ) in query expression 'First([Format(Sum(IIf([Evaluation
Result]="Pass",1,0))/Count([Evaluation Result]0,"Percent"])'.
--
Drock-13


:

Try this ---
Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Count([Evaluation
Result]),"Percent")

--
KARL DEWEY
Build a little - Test a little


:

I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


:

You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 
G

Guest

That worked! Thanks for all of the help.
--
Drock-13


KARL DEWEY said:
Use this in a footer of the report ---
= Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Sum(IIf([Evaluation
Result] Like "*",1,0)),"Percent")

--
KARL DEWEY
Build a little - Test a little


smeldawg said:
I have been trying all kinds of suggestions and by now I am really not sure
what is going on with this expression. Here is what i am trying to get. I
need to sum up a column on a report. This column is called Evaluation Result.
This column has either pass or fail in it. I want to sum up the column with %
representing the percent passed.

I am lost and would appreciate any help.

Thanks
--
Drock-13


KARL DEWEY said:
All you have to do is count the number of left parenthesis and the number of
right parenthesis and they must match.
What is this supposed to do ---
Count([Evaluation Result]0,"Percent"] ....?

--
KARL DEWEY
Build a little - Test a little


:

I tried this one and this is the error message I received:

Extra ) in query expression 'First([Format(Sum(IIf([Evaluation
Result]="Pass",1,0))/Count([Evaluation Result]0,"Percent"])'.
--
Drock-13


:

Try this ---
Format(Sum(IIf([Evaluation Result]="Pass",1,0))/Count([Evaluation
Result]),"Percent")

--
KARL DEWEY
Build a little - Test a little


:

I tried this and here is the error message I got:

Syntax error (comma) in query expression 'First([Format(Abs(Sum([Evaluation
Result="Pass"))/Count([Evaluation Result]),"percent")
])'.


--
Drock-13


:

You seem to be missing Format in the expression for one thing.

Format(Abs(Sum([Evaluation Result = "Pass"))/Count([Evaluation
Result]),"percent")

I also changed your expression to Count the records where there as a result
(pass or fail, but ignore blanks) and used a different expression to get the
count of passes.

If this doesn't solve the problem, perhaps you would like to tell us what
error you are seeing and where you are attempting to use the formula.

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

I have a field called Evaluation Result, that is either "pass" or "fail" in
a
query. I want the Evaluation Result to display the % Pass in a report.

Here is what I have so far:

(sum(iif([Evaluation Result]="Pass", 1,0))/sum(1),percent")

What am I doing wrong?
 

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