PC Review


Reply
Thread Tools Rate Thread

If statement in report

 
 
=?Utf-8?B?U3Byb3dsZXI=?=
Guest
Posts: n/a
 
      21st Jun 2007
I am trying to put in an calculated field in my report. I have a field
called "qualified" and in the field I would like it to total the number of
"yes" fields. I have tried =iff([qualified] = "yes",count"yes") but that
doesn't work. I think I am close. Does anyone have any suggestions.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGFsZSBGeWU=?=
Guest
Posts: n/a
 
      21st Jun 2007
Are you actually trying to do this in the report or in the reports query? Is
the field [qualified] actually a text field, or a Yes/No field?

1. If you are doing this in a query, and the [qualified] field is actually
a Yes/No data type, then it will have to be a group by query and the column
in the query grid would look something like:

NumQualified: ABS(SUM([Qualified]))

2. If you are doing it in a query, and the [qualified] field is text then,
try:

NumQualified: ABS(SUM(IIF([Qualified] = "yes", 1, 0)))

HTH
Dale
--
Email address is not valid.
Please reply to newsgroup only.


"Sprowler" wrote:

> I am trying to put in an calculated field in my report. I have a field
> called "qualified" and in the field I would like it to total the number of
> "yes" fields. I have tried =iff([qualified] = "yes",count"yes") but that
> doesn't work. I think I am close. Does anyone have any suggestions.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3Byb3dsZXI=?=
Guest
Posts: n/a
 
      21st Jun 2007
No, it's a calculated field that I am adding in a report.

"Dale Fye" wrote:

> Are you actually trying to do this in the report or in the reports query? Is
> the field [qualified] actually a text field, or a Yes/No field?
>
> 1. If you are doing this in a query, and the [qualified] field is actually
> a Yes/No data type, then it will have to be a group by query and the column
> in the query grid would look something like:
>
> NumQualified: ABS(SUM([Qualified]))
>
> 2. If you are doing it in a query, and the [qualified] field is text then,
> try:
>
> NumQualified: ABS(SUM(IIF([Qualified] = "yes", 1, 0)))
>
> HTH
> Dale
> --
> Email address is not valid.
> Please reply to newsgroup only.
>
>
> "Sprowler" wrote:
>
> > I am trying to put in an calculated field in my report. I have a field
> > called "qualified" and in the field I would like it to total the number of
> > "yes" fields. I have tried =iff([qualified] = "yes",count"yes") but that
> > doesn't work. I think I am close. Does anyone have any suggestions.

 
Reply With Quote
 
=?Utf-8?B?U3Byb3dsZXI=?=
Guest
Posts: n/a
 
      21st Jun 2007
No, it's a calculated field that I am adding into a report.

"Dale Fye" wrote:

> Are you actually trying to do this in the report or in the reports query? Is
> the field [qualified] actually a text field, or a Yes/No field?
>
> 1. If you are doing this in a query, and the [qualified] field is actually
> a Yes/No data type, then it will have to be a group by query and the column
> in the query grid would look something like:
>
> NumQualified: ABS(SUM([Qualified]))
>
> 2. If you are doing it in a query, and the [qualified] field is text then,
> try:
>
> NumQualified: ABS(SUM(IIF([Qualified] = "yes", 1, 0)))
>
> HTH
> Dale
> --
> Email address is not valid.
> Please reply to newsgroup only.
>
>
> "Sprowler" wrote:
>
> > I am trying to put in an calculated field in my report. I have a field
> > called "qualified" and in the field I would like it to total the number of
> > "yes" fields. I have tried =iff([qualified] = "yes",count"yes") but that
> > doesn't work. I think I am close. Does anyone have any suggestions.

 
Reply With Quote
 
=?Utf-8?B?U3Byb3dsZXI=?=
Guest
Posts: n/a
 
      21st Jun 2007
It is actually a calculated field that I am adding in a report. Suggestions?

"Dale Fye" wrote:

> Are you actually trying to do this in the report or in the reports query? Is
> the field [qualified] actually a text field, or a Yes/No field?
>
> 1. If you are doing this in a query, and the [qualified] field is actually
> a Yes/No data type, then it will have to be a group by query and the column
> in the query grid would look something like:
>
> NumQualified: ABS(SUM([Qualified]))
>
> 2. If you are doing it in a query, and the [qualified] field is text then,
> try:
>
> NumQualified: ABS(SUM(IIF([Qualified] = "yes", 1, 0)))
>
> HTH
> Dale
> --
> Email address is not valid.
> Please reply to newsgroup only.
>
>
> "Sprowler" wrote:
>
> > I am trying to put in an calculated field in my report. I have a field
> > called "qualified" and in the field I would like it to total the number of
> > "yes" fields. I have tried =iff([qualified] = "yes",count"yes") but that
> > doesn't work. I think I am close. Does anyone have any suggestions.

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      21st Jun 2007
Try

Count(IIF([Qualified]="Yes",1,Null))

or

Abs(Sum([Qualified]="Yes"))

That assumes the field is a text field and not a Yes/no (boolean) field.

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

"Sprowler" <(E-Mail Removed)> wrote in message
news:C07988D8-0203-4F97-9C6B-(E-Mail Removed)...
>I am trying to put in an calculated field in my report. I have a field
> called "qualified" and in the field I would like it to total the number of
> "yes" fields. I have tried =iff([qualified] = "yes",count"yes") but that
> doesn't work. I think I am close. Does anyone have any suggestions.



 
Reply With Quote
 
=?Utf-8?B?U3Byb3dsZXI=?=
Guest
Posts: n/a
 
      25th Jun 2007
Thanks John. The second string work perfectly and made for an impressive
report. Thank you very much!

"John Spencer" wrote:

> Try
>
> Count(IIF([Qualified]="Yes",1,Null))
>
> or
>
> Abs(Sum([Qualified]="Yes"))
>
> That assumes the field is a text field and not a Yes/no (boolean) field.
>
> --
> John Spencer
> Access MVP 2002-2005, 2007
> Center for Health Program Development and Management
> University of Maryland Baltimore County
> ..
>
> "Sprowler" <(E-Mail Removed)> wrote in message
> news:C07988D8-0203-4F97-9C6B-(E-Mail Removed)...
> >I am trying to put in an calculated field in my report. I have a field
> > called "qualified" and in the field I would like it to total the number of
> > "yes" fields. I have tried =iff([qualified] = "yes",count"yes") but that
> > doesn't work. I think I am close. Does anyone have any suggestions.

>
>
>

 
Reply With Quote
 
=?Utf-8?B?YWtyYW0=?=
Guest
Posts: n/a
 
      26th Jun 2007


"John Spencer" wrote:

> Try
>
> Count(IIF([Qualified]="Yes",1,Null))
>
> or
>
> Abs(Sum([Qualified]="Yes"))
>
> That assumes the field is a text field and not a Yes/no (boolean) field.
>
> --
> John Spencer
> Access MVP 2002-2005, 2007
> Center for Health Program Development and Management
> University of Maryland Baltimore County
> ..
>
> "Sprowler" <(E-Mail Removed)> wrote in message
> news:C07988D8-0203-4F97-9C6B-(E-Mail Removed)...
> >I am trying to put in an calculated field in my report. I have a field
> > called "qualified" and in the field I would like it to total the number of
> > "yes" fields. I have tried =iff([qualified] = "yes",count"yes") but that
> > doesn't work. I think I am close. Does anyone have any suggestions.

>
> To John Spencer

Thank you very much
the answer is very important and very useful.
programmer akram
iraq-basrah
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cbo to pass report criteria variable to report, need help on IF statement Kovax Microsoft Access Reports 0 10th Mar 2006 11:23 PM
vba: How do I write a "For Each Statement" nested in a "With Statement"? Mcasteel Microsoft Excel Programming 1 8th Nov 2004 10:47 PM
vba: How do I write a "For Each Statement" nested in a "With Statement"? Mcasteel Microsoft Excel Programming 1 8th Nov 2004 10:23 PM
vba: How do I write a "For Each Statement" nested in a "With Statement"? Mcasteel Microsoft Excel Programming 0 8th Nov 2004 10:08 PM
vba: How do I write a "For Each Statement" nested in a "With Statement"? Mcasteel Microsoft Excel Programming 0 8th Nov 2004 09:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:06 AM.